开发者

Using button in AdvancedDataGrid [duplicate]

This question already has an answer here: Closed 11 years ago.

Possible Duplicate:

Buttons in AdvancedDataGrid in Flex

i want data in an AdvancedDataGrid column to be displayed as buttons instead. That means the label of the button should display the text that the cell used to display . Can this be done using item renderer? The data provider to this grid is an Array and the array key that acts as datafield for this column is "AppNo". This is how i've set the button using itemRenderer -

<mx:AdvancedDataGridColumn headerText="Application No" dataField="AppNo" width="120">
 <mx:itemRenderer>
   <mx:Component>
    <mx:Button/>
   </mx:Component>
 </mx:itemRenderer>     
</mx:AdvancedDataGridColumn>

I tried setting label using label="{array["AppNo"]}开发者_如何学C" but did not work. Any clues??


<mx:AdvancedDataGridColumn headerText="Application No" dataField="AppNo" width="120">
 <mx:itemRenderer>
   <mx:Component>
    <mx:Button label="{data.AppNo}"/>
   </mx:Component>
 </mx:itemRenderer>     
</mx:AdvancedDataGridColumn>


add label tag to your button component as suggested it will work fine.

<mx:AdvancedDataGridColumn headerText="Application No" dataField="AppNo" width="120">
 <mx:itemRenderer>
   <mx:Component>
    <mx:Button label=""/>
   </mx:Component>
 </mx:itemRenderer>     
</mx:AdvancedDataGridColumn>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜