1 Reply Latest reply on Dec 24, 2009 4:40 AM by Karthik@Chennai

    I can't open a item of Tree.Help

    anaping wan Level 1

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="1024" minHeight="768">
      <mx:Script>
        <![CDATA[
         import mx.controls.Alert;
         import mx.controls.Tree;
         import mx.events.FlexEvent;
         private function ccc(e:FlexEvent):void
         {
         
         //excute expandItem
            (e.currentTarget as Tree).expandItem(XML(XML(e.currentTarget.dataProvider).node[1]),true,true);
            (e.currentTarget as Tree).validateNow();
         
         }
        ]]>
      </mx:Script>
      <mx:XML id="cc">
        <root>
         <node label="一班">
           <node label="小红"/>
           <node label="小命"/>
         </node>
         <node label="二班">
          <node label="小强"/>
          <node label="小大"/>
         </node>
        </root>
      </mx:XML>
      <mx:Tree  dataProvider="{cc}"  labelField="@label" showRoot="false"  width="300" height="500" creationComplete="ccc(event)"/>
      </mx:Application>

       

      why? Help me! My english is nod good!