oContactsGrid.sort (3, 'ascending');
When the page loads. The next challenge I have is how do I get the sort indicator to appear to let the user know which column the grid is sorted on? It works fine if I click a header to sort, but not when calling the "sort ()" method.
oContactsGrid.setSortProperty("index", i); oContactsGrid.setSortProperty("direction", d); oContactsGrid.refresh();
I think that should work i is column and d is 1 or 0, as I recolect anyway :)
you only need the refresh if you have already displayed the grid
I finally got it working with this code:
oContactsGrid.sort (3, 'ascending'); oContactsGrid.refresh ();
When I used:
oContactsGrid.sort (3, 'ascending'); oContactsGrid.getTemplate ('top/item', 3).refresh ();
The headers refreshed with the correct sort indicator, and the data sorted internally, but the grid data didn't update visually. I could see how using the 'top/item' refresh method would be useful for server-sorted data, however.
BTW, the sort direction must be 'ascending' or 'descending' (strings), not integer 0 or 1 to work.
I don't want to actually call the grid's sort () method, but I want to manipulate the sort indicator.
you should set the properties of the sort model
and then refresh the grid (or this particular header)
Is it possible to set different colors to the sort indicator? If so, how can this be accomplished?
This topic is archived.
Back to support forum
Version 2Looking for AW 2.6 ?
The old site is here.