Skip to main content



      Home
Home » Eclipse Projects » NatTable » sorting a tree column with equal roots issue
sorting a tree column with equal roots issue [message #1713347] Tue, 03 November 2015 09:30 Go to next message
Eclipse UserFriend
Hello,

I implemented a tree NatTable and I added custom comparator for each column.
It works fine but if roots have equal values the sort didn't work correctly and no more parent-child relationships are respected.
FYI, I implemented TreeList.Format and changed the compare method to take in consideration parent-child relationships.

Any help is welcome.
Thanks in advance,
Maherzia
Re: sorting a tree column with equal roots issue [message #1713684 is a reply to message #1713347] Thu, 05 November 2015 18:00 Go to previous message
Eclipse UserFriend
Quote:
changed the compare method to take in consideration parent-child relationships


if it is not working, I assume you didn't do it right. I myself struggled a while for this and still have no working solution.

IMHO having multiple equal elements on the same level in a tree is an error in the tree. Why should there be two elements on the same tree level that are equal? That violates the concepts of a tree, isn't it?

Nevertheless, if I understand correctly you want to achieve the following:

A
- A1
- A2
A
- A3
- A4

In such a case you need to ensure that the second A returns the correct compare value when compared to A2 and A3 but still be in the correct ordering regarding the tree levels. Not a trivial task.
Previous Topic:How to add additional columns in excel export
Next Topic:Set background color to specific row
Goto Forum:
  


Current Time: Fri Jun 13 10:33:53 EDT 2025

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

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

Back to the top