Automatically sorting dataGrid field

451
1
06-15-2011 09:07 AM
RobertMyers
New Contributor
Attached are two files. Working.txt will sort the first column in the DataGrid automatically.

The second file, NotWorking.txt, will not sort automatically for some reason. This file is a modify sample "Zoom to Found Features". Line 30 the test.dispatchEvent has been added and to the ID to DataGrid "test". I am not getting any errors but I am unable to determine why it's not working.

Any help would be appreciated.
Tags (2)
0 Kudos
1 Reply
RobertMyers
New Contributor
I found another way to do this. I modified the dataGridProvider for the dataGrid:

dataProvider="{sortAttributes(queryTask.executeLastResult.attributes)}"

And added the function sortAttributes. 16 is option for numerical sort to override default.

private function sortAttributes(attrSort:Array):Array
{
return attrSort.sortOn("OrderNo",16);
}
0 Kudos