Hi all,
I am trying to get a specific cell data based on rowindex and column index like this
%26lt;mx:Script%26gt;
%26lt;![CDATA[
import
mx.events.ListEvent;
public function itemClickEvent(event:ListEvent):void
{
clickColumn.text=String(event.columnIndex);
clickRow.text=String(event.rowIndex);
eventType.text=mygrid.dataProvider.getItemAt(clickRow)[clickColumn];
}
]]%26gt;
%26lt;/mx:Script%26gt;
%26lt;mx:DataGrid
x=''10'' y=''8'' width=''528'' dataProvider=''{MAIN01.dataProvider}'' height=''185'' itemClick=''itemClickEvent(event);'' draggableColumns=''true'' id=''mygrid''%26gt;
%26lt;mx:columns%26gt;
%26lt;mx:DataGridColumn headerText=''CLASS TYPE'' dataField=''CLASSTYPE''/%26gt;
%26lt;mx:DataGridColumn headerText=''YEARF'' dataField=''YEARF''/%26gt;
%26lt;mx:DataGridColumn headerText=''CLASS VALUE'' dataField=''CLASSVALUE''/%26gt;
%26lt;mx:DataGridColumn headerText=''PRODUCT'' dataField=''PRODUCT''/%26gt;
%26lt;/mx:columns%26gt;
%26lt;/mx:DataGrid%26gt;
%26lt;mx:Form%26gt;
%26lt;mx:FormItem label=''Column Index:''
%26gt;
%26lt;mx:Label id=''clickColumn''/%26gt;
%26lt;/mx:FormItem%26gt;
%26lt;mx:FormItem label=''Row Index:''
%26gt;
%26lt;mx:Label id=''clickRow''/%26gt;
%26lt;/mx:FormItem%26gt;
%26lt;mx:FormItem label=''Type:''
%26gt;
%26lt;mx:Label id=''eventType''/%26gt;
%26lt;/mx:FormItem%26gt;
%26lt;/mx:Form%26gt;
I dont want to hardcode the column name instead of columnindex because I want to capture where ever you click independent of column.
Now,
when I click on a cell I am getting rowindex and columnindex but I am not getting the text for eventType which is the getitemAt()
Please help me If I am doing anything wrong.
Regards,
Ganesh
No comments:
Post a Comment