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>
精彩评论