Default sorting the Dojo DataGrid
Posted: March 3rd, 2009 | Author: Joakim Andersson | Filed under: javascript | Tags: dojo, javascript | 5 Comments »This is how I have configure default sorting for our grids:
dojo.declare("DefaultSortableGrid", dojox.grid.DataGrid, {
sortInfo: 1 // the index (1-based) of the column
// to sort, + => asc, - => desc
});
And then I use DefaultSortableGrid when defining the grid:
<div dojoType="DefaultSortableGrid"
id="grid"
rowsPerPage="50">
</div>
Pretty simple really.