The data grid is defined below with a data provider of xmllist type:
<mx:columns>
<mx:DataGridColumn dataField="ans1" headerText="ans1"/>
<mx:DataGridColumn dataField="ans2" headerText="ans2"/>
<mx:DataGridColumn dataField="ans3" headerText="ans3"/>
<mx:DataGridColumn dataField="ans4" headerText="ans4"/>
</mx:columns>
On item click event i need to obtain the data(the text) associated to the current column in use. I have tried the following:
private function itemClickEvent(event:ListEvent):void {
var selected:String = event.currentTarget.selectedItem;
debug2.text = selected;
}
But, the debug label text displays the xmllist:
<question><ans1>a</ans1>...<ans4>d</ans4></question>
Try to use this code:
This is just a concept to show how to get the data from individual column.