Finding row index in TreeLayer [message #1386405] |
Tue, 17 June 2014 07:01  |
Eclipse User |
|
|
|
Hi All,
I created a nattable and customer wants to show the data in tree view. So i modified the code and i am able to see the data in tree.. In my previous design, i added a custom menu item- 'Insert Row' on RowHeaderLayer to add new row into the table. Now I want this same functionality in new design as well.. The code logic fails when my tree is in fully collapsed manner.. ie I have 5 treeNodes under eachnode i have 10 children... When i collapse all this treenode, the layer count becomes 5 so my row index in the table is 1,2,3,4,5.. If the user selects 1st tree node and click on 'Insert Row', its adding my new row on 2nd index - my previous logic is 1. Get the position from MouseEvent and then rowIndex and add the new row at rowIndex+1...
But in tree i need to insert this new row at end of this particular treenode..
My Question is a) Is there any way to find the original index of that particular row, if all treenodes are collapsed?
If we hide a row, the row index of next row is not changing, so my code works fine with row hide show option.. but if i collapse the row indexes are changed and my logic fails....
|
|
|
Re: Finding row index in TreeLayer [message #1386413 is a reply to message #1386405] |
Tue, 17 June 2014 08:17  |
Eclipse User |
|
|
|
If you are using GlazedLists (which I assume because of the tree representation) you need to operate on the underlying list instead of the TreeList. The TreeList transforms the underlying list, which means in your case, the children are removed from the TreeList representation. So there you don't get the original index. Instead you need to find the corresponding index in the underlying list representation for the element in the tree list.
|
|
|
Powered by
FUDForum. Page generated in 0.29170 seconds