If you have a buttonClickCall in your DataGrid and you want to access the whole DataGrid from your ItemRenderer call do the following:
add imports:
import mx.controls.DataGrid;
import mx.core.Application;
import mx.core.FlexGlobals;
access DataGrid in the following way:
var dataProvider = FlexGlobals.topLevelApplication.dataGrid.dataProvider;
var dataProvider = Application.application.dataGrid.dataProvider;
It will work despite the fact that these DataGrid variable is defined in a different mxml file.
ItemRenderer – ItemRendererXXX.mxml
Application – Name_Of_Your_App.mxml
You can that access all items in the following way:
for (var i:int = 0; i < dataProvider.length; i++)
{
item = dataProvider.getItemAt(i);
daneService.updateDane(item);
}
Its not working for me pls add some codes with this so that i can understand.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDelete_listData.owner as AdvancedDataGrid
ReplyDeletepublic override function get listData():BaseListData{
return _listData;
}
public override function set listData(value:BaseListData):void{
_listData = value as AdvancedDataGridListData;
column = _listData ? AdvancedDataGrid(_listData.owner).columns[_listData.columnIndex] as GridColumnMXTA : null;
}