Php 如何在flex的数据网格组件中找到动态创建的复选框是select/unselect?

Php 如何在flex的数据网格组件中找到动态创建的复选框是select/unselect?,php,apache-flex,air,flash,Php,Apache Flex,Air,Flash,我在数据网格上动态创建了复选框如何确定选中/取消选中的复选框以及联系人是选中/取消选中的复选框?因为我们不能为每个复选框设置动态id <mx:DataGrid x="7" y="3" width="347" height="337" dataProvider="{#####}" variableRowHeight="true"> <mx:columns> <mx:DataGridColumn headerText="S.No" dataFie

我在数据网格上动态创建了复选框如何确定选中/取消选中的复选框以及联系人是选中/取消选中的复选框?因为我们不能为每个复选框设置动态id

<mx:DataGrid x="7" y="3" width="347" height="337" dataProvider="{#####}" variableRowHeight="true">
    <mx:columns>
        <mx:DataGridColumn headerText="S.No" dataField="match_id" width="50"/>
        <mx:DataGridColumn headerText="Home" dataField="home_team" width="100"/>
        <mx:DataGridColumn headerText="Away" dataField="away_team" width="100"/>
        <mx:DataGridColumn headerText="1" >
            <mx:itemRenderer>
                <mx:Component>
            <mx:HBox verticalAlign="middle" paddingLeft="2">
                        <mx:CheckBox>
                        </mx:CheckBox>
                    </mx:HBox>
        </mx:Component>
    </mx:itemRenderer>
        </mx:DataGridColumn>
    <mx:DataGridColumn headerText="*" >
            <mx:itemRenderer>
                <mx:Component>
        <mx:HBox verticalAlign="middle" paddingLeft="2">
                        <mx:CheckBox>
                        </mx:CheckBox>
                    </mx:HBox>
        </mx:Component>
            </mx:itemRenderer>
        </mx:DataGridColumn>
        <mx:DataGridColumn headerText="2">
            <mx:itemRenderer>
                <mx:Component>
                    <mx:HBox verticalAlign="middle" paddingLeft="2">
                        <mx:CheckBox>
                        </mx:CheckBox>
                    </mx:HBox>
                </mx:Component>
            </mx:itemRenderer>
        </mx:DataGridColumn>
    </mx:columns>
</mx:DataGrid>

如果您为itemRenderer创建一个组件,而不是以上面表示的方式添加它们,这将使事情更加清楚。然后,如果该组件实现了IDropInListItemRender接口,您将能够侦听来自DataGrid上组件的事件。由于itemRenderer基于DataGrid的dataProvider中的数据,因此您可以在侦听的自定义事件中访问该信息

在itemRenderer组件中:

<mx:Checkbox id="myCheckbox" change="this.list.dispatchEvent(new CustomEvent(CustomeEvent.TYPE, myCheckbox.selected, this.data)) />

或者其他影响的东西。

格式化代码。说真的,是什么讨厌的编辑产生了这样的间距?谢谢Joel Hooks。它非常有用。是否有创建复选框并找出值的简单方法