如果我想检查父节点复选框意味着下面的子节点复选框将选择自动。
这是我的代码:
<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" />
项目渲染器文件
<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>
任何人都可以帮助谢谢....