Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Display values in GroupBy tree nodes
Display values in GroupBy tree nodes [message #1065460] Tue, 25 June 2013 19:03 Go to next message
Patrick Rusk is currently offline Patrick RuskFriend
Messages: 35
Registered: June 2012
I have some columns in my grids where we display a nice description, rather than the "canonical" code or number in the column. However, when I group by (in the meaning of the "Group by" example) those columns, the tree nodes that result show the canonical number/code. It seems to me that they should show the displayed values, instead.

The canonical value is shown because GroupByTreeFormat is instantiated by only passing in the IColumnAccessor for the grid. Something rather more GUI-ish would have to be passed in to get the displayed values. Technically, the display converters are gotten from the config registry based upon display modes and labels, so it gets quite involved.

In our setup, we have a slightly abominable way that we can hack this in to get what we want. Smile But, I wanted to open a discussion to see whether others think this should be done in a more official way.
Re: Display values in GroupBy tree nodes [message #1065477 is a reply to message #1065460] Tue, 25 June 2013 21:10 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2814
Registered: July 2012
Senior Member
Well the issue is the generic approach for group by. Technically the values that are displayed then are not of your object type, but of type GroupByObject. I started looking into this when I created the _5832_GroupByCustomTypesExample which is currently only available in the repository and not yet released with the examples.

I wasn't able to solve that issue in general easily. It is not that simple to get the display converter, as the GroupByObject is not aware of the cells that are used to group by. I guess a bigger refactoring of the whole group by solution would be necessary as it is not a trivial task.

In the example I helped myself by adding a toString() method that technically does the same as the IDisplayConverter.canonicalToDisplayValue()
Previous Topic:Disabling sorting on selected columns
Next Topic:Sorting in tree grid
Goto Forum:

Current Time: Sun Jul 25 09:08:52 GMT 2021

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

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

Back to the top