View Full Version : TreeTable sort

14 Jun 2009, 7:14 PM
Hi i m using a Treetable wich is populated via a RPC proxy. (like the one in the Example)
I tried to use the method sort in the Treetable class but that did not help.

looks like its not implemented in gxt 1.2.4

* Sorts the tree table using the specified column index.
* @param index the column index
* @param direction the direction to sort (NONE, ASC, DESC)
public void sort(int index, SortDir direction) {


Since i m populating the Tree from RPC i tried to sort the ArrayList of FileModel. But FileModel extends Basemodel and therefore each element of the Array is a HashTable wich is not sorted.

Any idea how i can sort a TreeTable.


15 Jun 2009, 4:36 AM

got it

public int compare(Store store, FileModel m1, FileModel m2, String property) {
boolean m1Folder = m1 instanceof FolderModel;
boolean m2Folder = m2 instanceof FolderModel;

return m1.get("name").toString().compareTo(m2.get("name").toString());


sry my bad.