Specify label of checkBox in itemrenderer dynamically

theriddler

New Member
I am using a checkBox in an itemRenderer in a flex datagrid. The label of the checkBox will change according to the dataProvider. And each label for each row in the datagrid is provided by an XML file as such:\[code\]<myXML> <labelTags> <labelTag_1></labelTag_1> <labelTag_2></labelTag_2> ...other tags as well here.. </labelTags></myXML>\[/code\]So in my datagrid I need to specify the label as show below in sort of an XML path. The part "THIS_PART_WILL_VARY" will at different stage change from labelTag_1, the to labelTag_2 then to labelTag_3 and so on.Can someone tell me how to do the concatenation below for the label attribute of the checkbox so that the XML path works correctly. If I hard code it as label= "{outerDocument.myXML.labelTags.labelTag_1}" or label= "{outerDocument.myXML.labelTags.labelTag_2}"..it works. This means am on the right way. But I need a dynamic way to do this.\[code\]<mx:DataGrid id="myGrid" dataProvider ="myDP" showHeaders="false" headerHeight="0"> <mx:columns> <mx:DataGridColumn headerText="" dataField="IS_ACCESSIBLE"> <mx:itemRenderer> <fx:Component> <mx:HBox horizontalAlign="left"> <s:CheckBox id="mycheckBox"label= "{outerDocument.myXML.labelTags.THIS_PART_WILL_VARY}"/> </mx:HBox> </fx:Component> </mx:itemRenderer> </mx:DataGridColumn> </mx:columns> </mx:DataGrid>\[/code\]Experts, your help will be much appreciated here.
 
Back
Top