Skip to main content



      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 04:58 Go to next message
Eclipse UserFriend
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 05:28 Go to previous messageGo to next message
Eclipse UserFriend
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 05:56 Go to previous messageGo to next message
Eclipse UserFriend
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 06:39 Go to previous message
Eclipse UserFriend
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: Wed Jul 16 08:22:24 EDT 2025

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

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

Back to the top