Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Unable to change row positions, when they are sorted
Unable to change row positions, when they are sorted [message #1162376] Wed, 30 October 2013 10:32 Go to next message
SD Khan is currently offline SD KhanFriend
Messages: 63
Registered: May 2013
Member
Hi Dirk,

I am using GlazedLists for storing rows, when i sort rows in the nattable by clicking on column header, rows are sorted correctly.

Now, i want's to move some of the rows on top, I do this by removing them from filter list and adding again on top but as rows are sorted, change does not get visible and rows remain positioned in their sorted order.

However, when i remove sorting or do this when rows are non-sorted then it works fine and rows get visible on top.


I think, sorting mechanism restrict rows to move on top, to maintain sorting order. is it right behavior ?, Is there any mode or a way through which i can change row positions when rows are already sorted ?

Thanks,
SD Khan
Re: Unable to change row positions, when they are sorted [message #1162395 is a reply to message #1162376] Wed, 30 October 2013 10:48 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Hi,

Quote:
I do this by removing them from filter list and adding again on top


- If you sort using GlazedLists, the underlying list is not sorted, instead you get a sorted view on the list.
- Your modifications are performed on the base list, which means you are changing the structure of the underlying list.

Having those two facts in mind it should be obvious that changes to the underlying list are not reflected if sorting is applied. If you have such a requirement you need to use a sort mechanism that really sorts your data (Collection.sort()) instead of having just a sorted view.

Greez,
Dirk

Re: Unable to change row positions, when they are sorted [message #1164019 is a reply to message #1162395] Thu, 31 October 2013 11:28 Go to previous message
SD Khan is currently offline SD KhanFriend
Messages: 63
Registered: May 2013
Member
By doing some more R&D i found the mode in sorted list, now I have changed the mode of SortedList from STRICT_SORT_ORDER to AVOID_MOVING_ELEMENTS. Now, restriction does not persist after sorting and i can move the rows if they are already in sorted order Smile.

Regards,
Safdar Khan
Previous Topic:Bulk/batch validation of entire table?
Next Topic:Help on ComboBoxCellEditor
Goto Forum:
  


Current Time: Sat Apr 20 01:50:16 GMT 2024

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

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

Back to the top