PDA

View Full Version : [GXT 3.0 beta2]Grid column could not be sorted while a row with null value!



zsumore
15 Jan 2012, 7:35 PM
Grid column could not be sorted while a row with null value.
How could i do?
Could i add a custom comparator?

premamonica
1 May 2012, 6:40 AM
Any updates on this thread? How do we add a custom comparator , I see that multi level sort was included in the road map for 3.0. And I do find, addSortInfo(int index, Store.StoreSortInfo<M> info) & Store.StoreSortInfo(java.util.Comparator<M> itemComparator, SortDir direction). Is there any examples which we could refer to?

premamonica
1 May 2012, 9:43 AM
I got a custom comparator, with 2 level sort to work correctly on the initially load.

I am now creating a HeaderClickHandler to also use the custom comparator, my question is how do I disable the default sort event which is triggered while the column header is clicked. Any inputs will be appreciated.

regards.

Colin Alworth
1 May 2012, 4:14 PM
@Zsemore ColumnConfig now supports setting a custom comparator, see ColumnConfig<M,N>.setComparator(Comparator<N>).

@premamonica Does ColumnConfig.setSortable(false) not prevent columns from being sortable?

premamonica
2 May 2012, 4:38 AM
Hi Colin, Thanks for the reply.

ColumnConfig.setSortable(false) did just work fine. I overlooked this method, assuming this might also disable the headerclick event. But I was wrong.

I have 70+columns in the grid , so I have used Grid.getView().setSortingEnabled(false) which also did the same.

premamonica
3 May 2012, 11:02 AM
Hi Collin , is there a way to remove the Sort Ascending and Sort Descending menu items from the Grid column menu?