0

If i want check parent node checkbox means below childerns checkbox will select automatic .

this is my code:

<fx:Script>
    <![CDATA[
        private function init():void    {
            httpTree.send();

        }

    ]]>
</fx:Script>
<fx:Declarations>
    <s:HTTPService id="httpTree" url="Assets/World.xml"  
                   resultFormat="e4x" useProxy="false" />
</fx:Declarations>
<mx:Tree dataProvider="{httpTree.lastResult.department}"
         id="treeTree" labelField="@name"   
         itemRenderer="com.ItemRenderForTree"  width="160" height="200" />

itemRenderer file

<fx:Script>
    <![CDATA[
        protected function checkboxSelectHandler(event:Event):void
        {

        }
    ]]>
</fx:Script>


<s:states>
    <s:State name="normal" />            
    <s:State name="hovered" />
    <s:State name="selected" />
</s:states>
<s:HGroup left="0" right="0" top="0" bottom="0" verticalAlign="middle">
    <s:Rect id="indentationSpacer" width="{treeListData.indent}" percentHeight="100" alpha="0">
        <s:fill>
            <s:SolidColor color="0xFFFFFF" />
        </s:fill>
    </s:Rect>
    <s:Group id="disclosureGroup">
        <s:BitmapImage source="{treeListData.disclosureIcon}" visible="{treeListData.hasChildren}" />
    </s:Group>
    <s:BitmapImage source="{treeListData.icon}" />
    <s:CheckBox change="checkboxSelectHandler(event)" />
    <s:Label id="labelField" text="{treeListData.label}" paddingTop="2"/>
</s:HGroup>

i want out like this

any one can help thanks....

Rajkamal
  • 425
  • 1
  • 7
  • 19

2 Answers2

0

Use tree dataDescriptor to access children nodes of clicked parent node. Maybe that could help? Does your three data have a selected property in datamodel?

Jarno Lahtinen
  • 1,713
  • 17
  • 30
0

You're looking for what I've always called a Schrodinger Check Box. Here is a same piece of code, including a working demo and the PNG resources for the checkbox over at adobe. Schrodinger Check Box

SuperSaiyen
  • 1,410
  • 10
  • 12