Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Make row index stable when Rowreorder is done
Make row index stable when Rowreorder is done [message #1782632] Tue, 27 February 2018 09:58 Go to next message
Gaurav Tripathi is currently offline Gaurav TripathiFriend
Messages: 43
Registered: September 2015
Member
Hi,

Whenever I apply RowReorderCommand on NatTable its index also moves with it.
Is it possible to make an index to be fixed as the way it is done in sorting?

Thanks in advance.
Re: Make row index stable when Rowreorder is done [message #1782642 is a reply to message #1782632] Tue, 27 February 2018 10:28 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Sure that is how the RowReorderLayer works. It does not actually reorder the underlying data structure, it provides a modified view on it. Sorting via GlazedLists does the same thing, but for you it is like the indexes are changed because you are looking at the SortedList. If you check the underlying data you will notice that there also no reordering happened.

If you ask for reordering the underlying collection on manually reorder the visual representation you will need to implement your own UI binding drag mode that triggers that. But that is something completely different from the NatTable architecture. You can do it, but there is no default implementation for it.
Re: Make row index stable when Rowreorder is done [message #1782644 is a reply to message #1782642] Tue, 27 February 2018 10:56 Go to previous messageGo to next message
Gaurav Tripathi is currently offline Gaurav TripathiFriend
Messages: 43
Registered: September 2015
Member
Quote:
If you ask for reordering the underlying collection on manually reorder the visual representation

No, I don't want that to happen. It just indexes which I want to make fixed.
Is it possible anyhow to make index fixed?
Re: Make row index stable when Rowreorder is done [message #1782648 is a reply to message #1782644] Tue, 27 February 2018 11:39 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
The question does not make any sense when knowing about the basic concept of index-position-transformation in NatTable. The index is the position of the an element in the underlying collection. That actually never changes as we do not change the ordering in the collection. The position in NatTable is simply incrementing in the view. So the position is fixed, while the position could point to another index, which is what happens in the RowReorderLayer or ColumnReorderLayer on reordering.

As I said, that is a basic concept and you can not "fix the index", whatever that means, since I don't understand what you actually want to do.
Previous Topic:Way to know if Sorting/Filtering is done on NatTable
Next Topic:Cell painting with Combination of images
Goto Forum:
  


Current Time: Fri Apr 26 18:45:46 GMT 2024

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

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

Back to the top