I have a spark DataGrid, where the user can sort the row by clicking the column headers... as expected. When they double click a row, it go to an edit. After clicking the save (or back button
[not the browser back button]) the are returned to the updated datagrid. I want to retain the sorting they had before the edit. Here is code I have to capture the sort column.
This does get the column name and columnIndices as expect. When the screen refreshes with the DataGrid, I have the follow code, which is being executed:Code:protected function onSortChange(event:GridSortEvent):void { app.sortColumnIndices = event.columnIndices; app.sortColumnName = event.newSortFields[0].name; }
The app.sortColumnIndices and app.sortColumnName both contain the "previous" values that I want to use in the sort.Code:if (app.sortColumnIndices){ dg.sortByColumns(app.sortColumnIndices); var sortColumnName:SortField = new SortField(app.sortColumnName,true); sortColumnName.setStyle("locale","en-US"); sort.fields = [sortColumnName]; entitiesDP.sort = sort; entitiesDP.refresh(); } dg.dataProvider = entitiesDP;
The problem is the DataGrid displays in the original, unsort order..... HELP! PLEASE!
Thanks-


Reply With Quote