Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache flex Flex中仅树叶节点上的复选框_Apache Flex_Actionscript 3_Flexbuilder_Mxml - Fatal编程技术网

Apache flex Flex中仅树叶节点上的复选框

Apache flex Flex中仅树叶节点上的复选框,apache-flex,actionscript-3,flexbuilder,mxml,Apache Flex,Actionscript 3,Flexbuilder,Mxml,我很难仅在树的叶节点上获取复选框 在任何人链接它之前,我已经看到了,这并不是我所需要的。我不想要一个同时包含分支和叶的3状态复选框系统 我理解将复选框项呈现器应用于数据网格,但不应用于树 我使用的是Flex Builder 3,假设我们想在AdvancedDataGrid的一列中添加复选框。我喜欢使用HierarchycalData或HierarchycalCollectionView作为我的datagrid的数据提供程序: // TestGrid <mx:AdvancedDataGrid

我很难仅在树的叶节点上获取复选框

在任何人链接它之前,我已经看到了,这并不是我所需要的。我不想要一个同时包含分支和叶的3状态复选框系统

我理解将复选框项呈现器应用于数据网格,但不应用于树


我使用的是Flex Builder 3,假设我们想在AdvancedDataGrid的一列中添加复选框。我喜欢使用HierarchycalData或HierarchycalCollectionView作为我的datagrid的数据提供程序:

// TestGrid
<mx:AdvancedDataGrid id="myADG">
    <mx:columns>
        <AdvancedDataGridColumn id="col1" />
        <AdvancedDataGridColumn id="col2" itemRenderer="LeafCheckbox" />
    </mx:columns>
</mx:AdvancedDataGrid>



// LeafCheckBox.mxml
<mx:Box 
    creationComplete="init(event)"
    implements="IDropInListItemRenderer">
<mx:Script>
    <![CDATA[

    // Internal variable for the property value.
    private var _listData:BaseListData;

    // Make the listData property bindable.
    [Bindable("dataChange")]

    // Define the getter method.
    public function get listData():BaseListData
    {
      return _listData;
    }

    // Define the setter method,
    public function set listData(value:BaseListData):void
    {
      _listData = value;
    }


    private function init(event:Event):void {
        var dg:AdvancedDataGrid = this.listData.owner.parent as AdvancedDataGrid;
        if (!dg.dataProvider.hasChildren(dg.selectedItem))
            this.addChild(new CheckBox());
    }

    ]]>
</mx:Script>

</mx:Box>
//TestGrid
//LeafCheckBox.mxml
这应该是其中的大部分。让我知道,谢谢