PDA

View Full Version : Disable Grid sorting



villemustonen
13 Nov 2008, 2:38 AM
Hello,

I need to implement my on version of sorting for my application's grid. I still want the results to be sorted when I click the column headers, but I will do this manually -- I sort the result when I send the a search query (Hibernate) to our DB. Therefore, I want to disable the local sorting of my grid. I tried the following:



resultGrid.addListener(Events.SortChange, new Listener<GridEvent>(){
public void handleEvent(GridEvent be) {
be.doit = false;
}
});
In which the SortChange event was fired(only once btw), but the sort itself was not cancelled.

I also tried adding the Listener to the store


store.addListener(ListStore.Sort, new Listener<StoreEvent>() {
public void handleEvent(StoreEvent be) {
be.doit = false;
searchModel.setSortField(((ListStore) be.store).getSortField());
}
});


This fires the sort event every time, but it does not cancel the local sorting.

There must be some way to disable local sorting alltogether...right?

--Ville