coolite ComboBox 中显示树

代码
   
     
< ext:ComboBox ID ="ComboBox1" runat ="server" Width ="250" Editable ="false" Mode ="Local"
ForceSelection
="false" MaxHeight ="200" AllowBlank ="true" >
< Items >
< ext:ListItem />
</ Items >
< Template ID ="Template1" runat ="server" >

< div id ="myTree" style ="height:200px" ></ div >
</ Template >
< Listeners >
< Expand Handler ="#{TreePanel1}.render('myTree');" />
</ Listeners >
</ ext:ComboBox >


< ext:TreePanel ID ="TreePanel1" AutoRender ="false" runat ="server" Border ="false" Icon ="BookOpen"
AutoScroll
="false" >
< Root >
< ext:TreeNode Text ="Composers" Expanded ="true" >
< Nodes >
< ext:TreeNode Text ="Beethoven" Icon ="UserGray" >
< Nodes >
< ext:TreeNode Text ="Concertos" >
< Nodes >
< ext:TreeNode Text ="No. 1 - C" NodeID ="1" Icon ="Music" />
< ext:TreeNode Text ="No. 2 - B-Flat Major" NodeID ="2" Icon ="Music" />
< ext:TreeNode Text ="No. 3 - C Minor" NodeID ="3" Icon ="Music" />
< ext:TreeNode Text ="No. 4 - G Major" NodeID ="4" Icon ="Music" />
< ext:TreeNode Text ="No. 5 - E-Flat Major" NodeID ="5" Icon ="Music" />
</ Nodes >
</ ext:TreeNode >
< ext:TreeNode Text ="Quartets" >
< Nodes >
< ext:TreeNode Text ="Six String Quartets" Icon ="Music" />
< ext:TreeNode Text ="Three String Quartets" Icon ="Music" />
< ext:TreeNode Text ="Grosse Fugue for String Quartets" Icon ="Music" />
</ Nodes >
</ ext:TreeNode >
< ext:TreeNode Text ="Sonatas" >
< Nodes >
< ext:TreeNode Text ="Sonata in A Minor" Icon ="Music" />
< ext:TreeNode Text ="sonata in F Major" Icon ="Music" />
</ Nodes >
</ ext:TreeNode >
< ext:TreeNode Text ="Symphonies" >
< Nodes >
< ext:TreeNode Text ="No. 1 - C Major" Icon ="Music" />
< ext:TreeNode Text ="No. 2 - D Major" Icon ="Music" />
< ext:TreeNode Text ="No. 3 - E-Flat Major" Icon ="Music" />
< ext:TreeNode Text ="No. 4 - B-Flat Major" Icon ="Music" />
< ext:TreeNode Text ="No. 5 - C Minor" Icon ="Music" />
< ext:TreeNode Text ="No. 6 - F Major" Icon ="Music" />
< ext:TreeNode Text ="No. 7 - A Major" Icon ="Music" />
< ext:TreeNode Text ="No. 8 - F Major" Icon ="Music" />
< ext:TreeNode Text ="No. 9 - D Minor" Icon ="Music" />
</ Nodes >
</ ext:TreeNode >
</ Nodes >
</ ext:TreeNode >
</ Nodes >
</ ext:TreeNode >
</ Root >
< Listeners >
< Click Handler ="#{ComboBox1}.setValue(node.text);#{ComboBox1}.collapse();" />
<% --< Click Handler = " if(!node.hasChildNodes()){#{ComboBox1}.setValue(node.text);#{ComboBox1}.collapse();} " />-- %>
</ Listeners >
</ ext:TreePanel >

 

 

你可能感兴趣的:(combobox)