Specifying a Default Sort for Dojo Datagrids
Posted in Inside TFG
I spent five minutes finding this today (don’t get me started on Dojo documentation!) so I thought I’d try and put it in an easier to find place – Google.
I wanted to specify my sort order declaratively as part of the tag defining my Datagrid and this is what I found to work :
table dojoType="dojox.grid.DataGrid" store="store" sortInfo="-4"
This will tell the datagrid to automatically sort the Datagrid in a descending manner on column 4. If I’d used 5, or “+5″ then that would be in ascending sort order on the fifth column.
Sagar
Oct 14, 2011
Thanks!