PDA

View Full Version : [FIXED] [beta3] TreeStore.sort



LukasP
20 May 2008, 2:56 PM
Hi,

maybe I am missing something but TreeStore.sort(String field, SortDir sortDir) does not do anything.

Store defines:



public void sort(String field, SortDir sortDir) {
sortInfo.setSortField(field);
sortInfo.setSortDir(sortDir);
applySort();
}

...

protected void applySort() {

}
but TreeStore has a different signature for applySort:



protected void applySort(List<M> list) {
if (storeSorter != null) {
Collections.sort(list, new Comparator<M>() {
public int compare(M m1, M m2) {
return storeSorter.compare(TreeStore.this, m1, m2, sortInfo.getSortField());
}
});
}
}
applySort(List) is called in onLoad() of TreeStore, however it is not working for me either...

any ideas?

darrellmeyer
20 May 2008, 8:06 PM
TreeStore and sorting was not fully implemented. The sort method has been removed from Store (remains on ListStore). To sort a TreeStore you now use setStoreSorter and optionally the new setSortInfo method on TreeStore. Fixes are in SVN.

LukasP
21 May 2008, 1:20 AM
Well, as I am part of the OSS-community: When will this code be available for me? ;)

darrellmeyer
21 May 2008, 5:18 AM
The new code will be available in the next release.