【问题标题】:Flex: Buttons in datagrid, is that posible to access properties of the columnFlex:数据网格中的按钮,是否可以访问列的属性
【发布时间】:2010-11-20 13:55:04
【问题描述】:

例如 我有以下数据网格

<mx:DataGrid x="331" y="16" height="132" width="419" id="me_claimed" dataProvider="{users.myclaims}"
useRollOver="false">
<mx:columns>
    <mx:DataGridColumn headerText="Claimer" dataField="opponent"/>
    <mx:DataGridColumn headerText="Rank" dataField="rank"/>


    <mx:DataGridColumn headerText="Dismiss claim">
        <mx:itemRenderer>
            <mx:Component>
                <mx:Button label="Delete">
                    <mx:click>
                        <![CDATA[
                            Alert.show("test");

                        ]]>
                    </mx:click>
                    <mx:Script>
                        <![CDATA[
                            import mx.controls.Alert;
                        ]]>
                    </mx:Script>
                </mx:Button>
            </mx:Component>
        </mx:itemRenderer>
    </mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>

单击删除按钮后,我想将对手的名称发送到网络服务器。我可以在点击事件时访问数据网格中的对应值吗?

【问题讨论】:

    标签: apache-flex datagrid


    【解决方案1】:

    是通过数据对象:

    Alert.show(data.opponent);

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-15
      • 2010-12-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多