Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Filter restarting the row numbers from "1"(After applying filter the displayed row numbers/ id's are starting from "1")
Filter restarting the row numbers from "1" [message #1802767] Fri, 15 February 2019 12:17 Go to next message
Hithesh Kalepalli is currently offline Hithesh KalepalliFriend
Messages: 1
Registered: February 2019
Junior Member

I am new to NAT Table. Using filterrowheader I have implemented the functionality to filter the rows in a table. However, after applying filter the displayed row numbers will start from "1". But my requirement is to retain the original row indexes as the displayed row numbers.

From some of the earlier posts I understand that the "viewportlayer" is responsible for this behavior. Is there any way I can turn-off/ control this behavior.

Also, I read about the "Position-Index transformation" and I am successful in getting the actual row index. My query is whether I can override the displayed row numbers with the actual row Indexes. If yes, can you please suggest the approach that need to be taken.

Thanks in advance.


Re: Filter restarting the row numbers from "1" [message #1802980 is a reply to message #1802767] Wed, 20 February 2019 05:43 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2814
Registered: July 2012
Senior Member

your understanding that the ViewportLayer is responsible for this behavior is not correct. The numbers shown in the row header are delivered by the DefaultRowHeaderDataProvider. And that one simply delivers the index of the item in the list. That it is not always starting from 1 on scrolling is related to the dimensional dependency to the ViewportLayer. But nothing more.

The ViewportLayer and the layers below operate on the FilterList as you said you implemented filtering. The FilterList is a transformed representation of the base list, that actually means, from looking at the FilterList, the indexes are what you see in the row header. You actually want to show the indexes of the base list.

To do this you need to implement a custom RowHeaderDataProvider that is able to calculate the row index based on the row index of the FilterList. So you probably need to retrieve the object via index in the FilterList and then get the index of that object from the base list.

As a side note: for huge data sets such a solution will not scale well.
Previous Topic:How to re-configure the column group header
Next Topic:Spanned Cells show not always the data of the first column
Goto Forum:

Current Time: Fri Jul 30 20:29:25 GMT 2021

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

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

Back to the top