~katiekitty/+junk/solidstate

« back to all changes in this revision

Viewing changes to solidstate/trunk/include/dhtmlxTree/samples/.svn/text-base/dhtmlXTree.cfm.svn-base

  • Committer: root
  • Date: 2010-01-13 07:44:31 UTC
  • Revision ID: root@ds3-vamp.cs-monitor.cz.cc-20100113074431-kt8ceoeznpjg22x7
Reviving the project

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<cfsetting enablecfoutputonly="yes">
 
2
<cfparam name="attributes.width" default="100%">
 
3
<cfparam name="attributes.height" default="100%">
 
4
<cfparam name="attributes.name" default="t#left(replace(CreateUUID(),'-','','All'),15)#">
 
5
<cfparam name="attributes.JSPath" default="js/">
 
6
<cfparam name="attributes.CSSPath" default="css/">
 
7
<cfparam name="attributes.iconspath" default="imgs/">
 
8
<cfparam name="attributes.xmldoc" default="">
 
9
<cfparam name="attributes.checkboxes" default="none"> <!--- [ Scand:  none, twoState, threeState  ] --->
 
10
<cfparam name="attributes.dragndrop" default="false">
 
11
<cfparam name="attributes.style" default="background-color:whitesmoke;border:1px solid blue;">
 
12
<cfparam name="attributes.onSelect" default="">
 
13
<cfparam name="attributes.onDrop" default="">
 
14
<cfparam name="attributes.onCheck" default="">
 
15
<cfparam name="attributes.xmlFile" default="">
 
16
 
 
17
<cfparam name="attributes.im1" default="">
 
18
<cfparam name="attributes.im2" default="">
 
19
<cfparam name="attributes.im3" default="">
 
20
 
 
21
<cfif not ThisTag.HasEndTag>
 
22
   <cfabort showerror="You need to supply a closing &lt;CF_dhtmlXTree&gt; tag.">
 
23
</cfif>
 
24
 
 
25
<cfif ThisTag.ExecutionMode is "End">
 
26
        <cfsavecontent variable="treeOutput">
 
27
                <cfoutput>
 
28
                <cfif not isDefined("request.dhtmlXTreeScriptsInserted")>
 
29
                        <link rel="STYLESHEET" type="text/css" href="#attributes.CSSPath#dhtmlXTree.css">
 
30
                        <script  src="#attributes.JSPath#dhtmlXCommon.js"></script>
 
31
                        <script  src="#attributes.JSPath#dhtmlXTree.js"></script>       
 
32
                        <cfset request.dhtmlXTreeScriptsInserted=1>
 
33
                </cfif>
 
34
                <div id="treebox_#attributes.name#" style="width:#attributes.width#; height:#attributes.height#; overflow:auto; #attributes.style#"></div>
 
35
                <script>
 
36
                        function drawTree#attributes.name#(){
 
37
                        #attributes.name#=new dhtmlXTreeObject('treebox_#attributes.name#',"100%","100%",0);
 
38
                        #attributes.name#.setImagePath("#attributes.iconspath#");
 
39
                                <cfswitch expression="#attributes.checkboxes#">
 
40
                        <cfcase value="twoState">
 
41
                                #attributes.name#.enableCheckBoxes(true)
 
42
                                #attributes.name#.enableThreeStateCheckboxes(false);
 
43
                        </cfcase>
 
44
                        <cfcase value="threeState">
 
45
                                #attributes.name#.enableCheckBoxes(true)
 
46
                                #attributes.name#.enableThreeStateCheckboxes(true);
 
47
                        </cfcase>
 
48
                        <cfdefaultcase>
 
49
                                #attributes.name#.enableCheckBoxes(false)
 
50
                                #attributes.name#.enableThreeStateCheckboxes(false);
 
51
                        </cfdefaultcase>
 
52
                                </cfswitch>
 
53
                        <cfif len(attributes.onSelect)>
 
54
                                #attributes.name#.setOnClickHandler("#attributes.onSelect#");
 
55
                        </cfif>
 
56
                        <cfif len(attributes.onCheck)>
 
57
                                #attributes.name#.setOnCheckHandler("#attributes.onCheck#");
 
58
                        </cfif>
 
59
                        <cfif len(attributes.onDrop)>
 
60
                                #attributes.name#.setDragHandler("#attributes.onDrop#");
 
61
                        </cfif>                                 
 
62
                                #attributes.name#.enableDragAndDrop(#attributes.dragndrop#)
 
63
                        <cfif (len(attributes.im1) or len(attributes.im2)) or len(attributes.im3)>
 
64
                                #attributes.name#.setStdImages("#attributes.im1#","#attributes.im2#","#attributes.im3#");
 
65
                        </cfif>
 
66
                        <cfif len(attributes.xmlFile)>
 
67
                                #attributes.name#.setXMLAutoLoading("#attributes.xmlFile#");
 
68
                                #attributes.name#.loadXML("#attributes.xmlFile#")
 
69
                        </cfif>
 
70
                        <cfif Len(Trim(ThisTag.GeneratedContent))>
 
71
                                #attributes.name#.loadXMLString("<?xml version='1.0'?><tree id='0'>#replace(replace(ThisTag.GeneratedContent,'"',"'","ALL"),"#chr(13)##chr(10)#","","ALL")#</tree>")
 
72
                        </cfif>         
 
73
                        };
 
74
                        window.setTimeout("drawTree#attributes.name#()",100);   
 
75
                </script>
 
76
                </cfoutput>
 
77
                
 
78
        </cfsavecontent>
 
79
 
 
80
    <cfset ThisTag.GeneratedContent = treeOutput>
 
81
</cfif>
 
82
<cfsetting enablecfoutputonly="no">
 
 
b'\\ No newline at end of file'