按钮在的AdvancedDataGrid Flex中 [英] Buttons in AdvancedDataGrid in Flex
本文介绍了按钮在的AdvancedDataGrid Flex中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有可能有一个按钮
对象在Flex 4中的的AdvancedDataGrid
对象列?而且我会怎么做呢?
Is it possible to have a Button
object in a column in an AdvancedDataGrid
object in flex 4? And how would I do this?
推荐答案
您可以做到这一点在Flex 3的,所以它应该是可能的Flex 4中得。这里是如何做到这一点的弯曲3,修改它的火花。
You can do it in flex 3, so it should be possible in flex 4 too. Here is how to do it in flex 3, modify it for spark.
<mx:AdvancedDataGrid id="ad" creationComplete="create();">
<mx:columns>
<mx:AdvancedDataGridColumn dataField="text"/>
<mx:AdvancedDataGridColumn>
<mx:itemRenderer>
<mx:Component>
<mx:Button label="{data.buttonLabel}"
click="{outerDocument.onClick(data)}"/>
</mx:Component>
</mx:itemRenderer>
</mx:AdvancedDataGridColumn>
</mx:columns>
</mx:AdvancedDataGrid>
脚本:
public function create():void
{
var array:Array = [{text:"Text1", buttonLabel:"Bt1"},
{text:"Text2", buttonLabel:"Bt2"}]
ad.dataProvider = new ArrayCollection(array);
}
public function onClick(item:Object):void
{
trace(item.text);
}
这篇关于按钮在的AdvancedDataGrid Flex中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文