IGridCommandEventArgs and IGridListener interfaces.
In this example, we let the database do the row sorting using the standard ORDER BY SQL clause. The sort parameters
are posted to the server and can be extracted out via the IGridCommandEventArgs interface. The sort parameters
can then be translated into SQL. The last part is to inform the grid that the rows are already sorted. This can be done
using the doCustomSort callback method.
public boolean doCustomSort(ISortContext sortContext) {
// Tell the grid we are sorting upon the first display of the grid.
if (isPost == false) {
sortContext.setSortColumnNumber(sortColumn);
sortContext.setSortType(sortType);
}
return true;
}
By returning true, you are telling the grid not to sort the rows. In the above example, the two setter calls
are necessary since we are showing the grid as sorted when it first displays (isPost == false).
CustomSortAction.java
MyGridListenerCustomSort.java
|
home : products : pricing : company : contact us : samples : download : forums : customers Copyright © 2000-2004 dotJ Software Inc. All rights reserved. |