Disabling sorting on selected columns [message #1065399] |
Tue, 25 June 2013 14:52 |
Testr t Messages: 93 Registered: April 2013 |
Member |
|
|
Hi,
I am using tree grid in my application and I want to enable sorting only on specific columns. To achieve this I have added label(say SORT) on columns that I want sorting to be enabled and registered this attribute
configRegistry.registerConfigAttribute( SortConfigAttributes.SORT_COMPARATOR, new DefaultComparator(), DisplayMode.NORMAL, "SORT" );
To disable sorting on columns, I have registered NOSORT label.
configRegistry.registerConfigAttribute( SortConfigAttributes.SORT_COMPARATOR, new DefaultComparator(), DisplayMode.NORMAL, "NOSORT" );
As specified in the example single click sorting is enabled like,
nattable.addConfiguration( new SingleClickSortConfiguration() );
But this enables sorting on all columns. Is this the correct way to disable sorting?
|
|
|
|
|
Re: Disabling sorting on selected columns [message #1065416 is a reply to message #1065415] |
Tue, 25 June 2013 15:45 |
Testr t Messages: 93 Registered: April 2013 |
Member |
|
|
Sorry the code had the type when I pasted here. For NOSORT, I registered new NULLComparator.
Disabling sorting on selected columns [message #1065399] Tue, 25 June 2013 10:52
Testr t
Messages: 50
Registered: April 2013
Member
Hi,
I am using tree grid in my application and I want to enable sorting only on specific columns. To achieve this I have added label(say SORT) on columns that I want sorting to be enabled and registered this attribute
Code: [Select all] [Show/ hide]
configRegistry.registerConfigAttribute( SortConfigAttributes.SORT_COMPARATOR, new DefaultComparator(), DisplayMode.NORMAL, "SORT" );
To disable sorting on columns, I have registered NOSORT label.
Code: [Select all] [Show/ hide]
configRegistry.registerConfigAttribute( SortConfigAttributes.SORT_COMPARATOR, new NullComparator(), DisplayMode.NORMAL, "NOSORT" );
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02271 seconds