Sorting function not called in Flex Datagrid
I am creating a Datagrid in AS3, and adding a sort function to a column. However, this sort function does never get called. Any ideas?
dg_gruppenUebersicht = new NestedDataGrid;
开发者_如何学Go dg_gruppenUebersicht.sortableColumns = true;
dg_gruppenUebersicht.dataProvider = arrCol_gruppenTnAkt;
dg_gruppenUebersicht.columns = new Array;
var cols : Array = dg_gruppenUebersicht.columns;
//initalize datagrid
var dgc : DataGridColumn = new DataGridColumn( "Jahrgang" );
dgc.dataField = "TnJahrgang";
dgc.labelFunction = MyFormatter.lblfunc_alter2jahrgang;
dgc.sortable = true;
dgc.sortCompareFunction = compareFunc_tnJahrgang;
dgc.headerText = "Alter";
dgc.headerRenderer = new ClassFactory( at.moschitz.VDGHeader );
dgc.width = 20;
cols.push( dgc );
dg_gruppenUebersicht.columns = cols;
Strangely, the label function gets called.
Thanks Martin
Try calling arrCol_gruppenTnAkt.refresh();
at the end.
Are there other columns in the data grid? If so, did you click on the dgc column so that the grid is sorted as per this column?
精彩评论