CTreeView is used to display data with hierarchies, using the TreeView to set up the Data property. Data is an array with the following structure:
Ext:string, the text of the tree node.
Expanded:boolean, optionally, indicates whether the node is expanded.
Id:string, optional, the node ID.
Haschildren:boolean, optionally, the default is False, and when True indicates that the node contains child nodes.
Children:array, optional, sub-node array.
Htmloptions:array, HTML options.
So far we haven't introduced the read database, so this example uses the hard code data as follows:
Array (' text ' => ' <a id= "href=" # ">World:4</a>", ' id ' => ' ", ' HasChildren ' => true, ' children ' => Array (' text ' => ' <a id=
"1" href= "#" >Europa:3</a> ", ' id ' => ' 1 ', ' HasChildren ' => true, ' Children ' => Array (' text ' => ' <a Id= "3" href= "#" >Germany:3</a> ", ' id ' => ' 3 ', ' HasChildren ' => True, ' Children ' => Array (array
(' text ' => ' <a id= ' "href=" # ">Munich:0</a>",
' id ' => ', ' HasChildren ' => false,),
Array ' Text ' => ' <a id= ' href= ' # ' >Stuttgart:0</a> ', ' ID
' => ', ' HasChildren ' => false,),
Array (' text ' => ' <a id= "5" href= "#" >Berlin:0</a> ",
' ID ' => ' 5 ', ' HasChildren ' => false,) ), array (' text ' => ' <a id= "2" href= "#" >norway:3< ;/a> ', ' id ' => ' 2 ', ' HasChildren ' => true, ' ch Ildren ' => Array ('
Text ' => ' <a id= ' href= ' # ' >Stavanger:0</a> ', ' id ' => ' 10 ', ' HasChildren ' => false,), array (' Text
' => ' <a id= ' href= ' # ' >Oslo:0</a> ', ' id ' => ' 12 ',
' HasChildren ' => false,), array (
' Text ' => ' <a id= ' href= ' # ' >Bergen:0</a> ', ' id ' => ' 11 ',
' HasChildren ' => false,)), Array (
' Text ' => ' <a id= ' 4 "href=" # ">united kingdom:2</a>", ' id ' => ' 4 ',
' HasChildren ' => true, ' children ' => Array ( Array (' text ' => ' <a id= "href=" # ">London:0</a>
' , ' id ' => ', ' HasChildren ' => false,),
Array (' text ' => ' <a id= "href=" # ">Manchester:0</a>",
' id ' => ', ' HasChildren ' => false,
)), array (' text ' => ' <a id= "7" href= "#" >Asia:3</a> ", ' ID ' => ' 7 ', ' HasChildren ' => true, ' children ' =&
Gt Array (' text ' => ' <a id= ' "href=" # ">Japan:0</a>", ' id ' => ', ' HasChildren ' => False,), array (' text ' => ' <A id= "href=" # ">China:0</a>", ' id ' => ', ' H Aschildren ' => false,), Array (' Te
XT ' => ' <a id= ' href= ' # ' >Indonesia:0</a> ', ' id ' => ' 19 ',
' HasChildren ' => false,)), Array (' text ' => ' <a id= "9" href= "#" >America:4</a> ", ' ID ' => ;
' 9 ', ' HasChildren ' => true, ' children ' => array (Array (' text ' => ' <a id= ") href=" # ">cana
Da:0</a> ', ' id ' => ', ' HasChildren ' => false, ), array (' text ' => ' <a id= "href=" # ">united S Tates:0</a> ', ' id ' => ', ' HasChildren ' => FAL SE,), array (' text ' => ' <a id= ') "Href=" # ">Mexico:0</a>", ' id ' => ', ' Haschi Ldren ' => false,), array (' text ' =
> ' <a id= ' href= ' # ' >Argentina:0</a> ', ' id ' => ' 26 ', ' HasChildren ' => false,)), Array (' Te XT ' => ' <a id= "8" href= "#" >Africa:2</a> ', ' id ' => ' 8 ', ' ha Schildren ' => true,
' Children ' => Array (Array ( ' Text ' => ' <a id= ' href= ' # ' >Kenya:0</a> ', ' id ' => ' 22 ' , ' HasChildren ' => false,), array
(' text ' => ' <a id= ' "href=" # ">Tanzania:0</a>",
' id ' => ', ' HasChildren ' => false) )
)
)))));