I bind an array of elements to a data grid using ItemRenderer. I use a variable datato manage related data. I also have someComponentVariableone that needs to be inserted into each row, but to declare it in the component area, so the data grid does not seem to re-sort it (compilation error).
How to use this variable ( someComponentVariable) inside ItemRenderer?
Code example
<mx:DataGrid id="userBonusesGrid" width="100" height="248" showHeaders="false" wordWrap="true">
<mx:columns>
<mx:DataGridColumn headerText="" width="36">
<mx:itemRenderer>
<mx:Component>
<mx:VBox verticalAlign="middle" horizontalAlign="center">
<ns1:SidePanelBonus
bonusName="{data.name}" description="{data.description}"
arrow="{someComponentVariable}">
</ns1:SidePanelBonus>
</mx:VBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
source
share