Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Programmatically sorting works only when column is visible
Programmatically sorting works only when column is visible [message #1726150] Thu, 10 March 2016 07:58 Go to next message
Quang Tran is currently offline Quang TranFriend
Messages: 25
Registered: June 2012
Junior Member
I have a Table with lots of columns. When opening my table I want to have an initial sorting of a column which is not visible.
By doing so I used the SortColumnCommand
 natTable.doCommand( new SortColumnCommand( natTable,
                               MyTableConstants.TIME_COLUMN_POSITION + 1, SortDirectionEnum.DESC ) );


This is not working unless the column is currently visible in the viewport.
Is there a way to force it?

P.S not visible != hidden
Re: Programmatically sorting works only when column is visible [message #1726153 is a reply to message #1726150] Thu, 10 March 2016 08:06 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Not via command. The concept of commands is to use the position and transform it. This is to support user interactions. If you want to sort by hidden columns you will need to access the SortHeaderLayer API directly, because the command should not get to that layer as the column is hidden.
Re: Programmatically sorting works only when column is visible [message #1726167 is a reply to message #1726150] Thu, 10 March 2016 09:41 Go to previous message
Quang Tran is currently offline Quang TranFriend
Messages: 25
Registered: June 2012
Junior Member
Hi Dirk,
thanks for your response. Using the SortHeaderLayer API worked out for me.
Previous Topic:Bug or wanted behavior: selectAll
Next Topic:Cell decoration
Goto Forum:
  


Current Time: Fri Apr 26 20:19:14 GMT 2024

Powered by FUDForum. Page generated in 0.03082 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top