views:

260

answers:

1

<mx:Script>
    <![CDATA[
        private function openAllNodes():void {
            tree.openItems = dp..node;
        }

        private function closeAllNodes():void {
            tree.openItems = [];
        }
    ]]>
</mx:Script>

<mx:XML id="dp">
    <root>
        <node label="Parent 1">
            <node label="Child 1" />
            <node label="Child 2">
                <node label="Grandchild 1" />
                <node label="Grandchild 2" />
            </node>
            <node label="Child 3" />
            <node label="Child 4" />
        </node>
    </root>
</mx:XML>

<mx:ApplicationControlBar dock="true">
    <mx:Button label="Open all nodes" click="openAllNodes();" />
    <mx:Button label="Close all nodes" click="closeAllNodes();" />
</mx:ApplicationControlBar>

<mx:Tree id="tree"
        dataProvider="{dp}"
        showRoot="false"
        labelField="@label"
        width="200" />

Unless or other wise i click my parent list, the child or the next list must be in a disabled state.

I click on Child 1, then only Child 2 Must be able to select.

Please Help Me.

A: 

It sounds like you might want to extend the tree class and override some of the methods to implement your special functionality. Look at overriding the drawItem, mouseClickHandler, and possibly the expandItem functions.

slukse