Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Column Grouping for Tree Grid(Column Grouping for Tree Grid)
Column Grouping for Tree Grid [message #1700675] Mon, 06 July 2015 12:03 Go to next message
Anand Prasad is currently offline Anand PrasadFriend
Messages: 1
Registered: July 2015
Junior Member
Hi All,

I am using Tree to display my values . I need to group few columns in the similar way that we have in the NAT tables.. I tried using the same way I did for table for tree ,but my column grouping are not displayed at all.

I am using the below code to create my column header layer,
public ILayer createColumnHeaderLayer()
    {
    	final ColumnGroupModel columnGroupModel = new ColumnGroupModel();

    	
        columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(columnHeaderDataProvider);
        columnHeaderLayer = new ColumnHeaderLayer(columnHeaderDataLayer, treeLayer, treeLayer.getSelectionLayer());
       
       ColumnGroupHeaderLayer columnGroupHeaderLayer = new ColumnGroupHeaderLayer(columnHeaderLayer, treeLayer.getSelectionLayer(), columnGroupModel);
       columnGroupHeaderLayer.addColumnsIndexesToGroup("Column Group 1",3,4,5,6,7,8);
       
       ColumnGroupHeaderLayer toolcolumnGroupHeaderLayer = new ColumnGroupHeaderLayer(columnHeaderLayer, treeLayer.getSelectionLayer(), columnGroupModel);
       toolcolumnGroupHeaderLayer.addColumnsIndexesToGroup("Column Group 2",9,10,11,12,13,14);
       
        columnGroupHeaderLayer.setRowHeight(25);
        columnHeaderDataLayer.setColumnWidthByPosition(3, 10);
        columnHeaderDataLayer.setColumnWidthPercentageByPosition(0, 80);
        columnHeaderDataLayer.setDefaultColumnWidth(200);
        columnHeaderDataLayer.setDefaultColumnWidthByPosition(0, 1000);
       
        return columnGroupHeaderLayer;

    }

Is there a issue with the above code ?
Are column groupings supported in tree?
Can you provide me a sample ?


Thanks in Advance.
Re: Column Grouping for Tree Grid [message #1700783 is a reply to message #1700675] Tue, 07 July 2015 07:39 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
Quote:
Is there a issue with the above code ?


Not at first sight. I'm not sure why there are two GolumnGroupHeaderLayer and it setting the row height has an impact.

Quote:
Are column groupings supported in tree?


Sure, why shouldn't it? The column header has no impact on the body, and the tree rendering is part of the body.

Quote:
Can you provide me a sample ?


NatTable Examples -> Tutorial Examples -> Integration -> SortableGroupByFilterColumnGroupAndFreezeExample
Previous Topic:Is searching supported?
Next Topic:Search/Filter on converted data
Goto Forum:
  


Current Time: Sat Mar 06 11:45:28 GMT 2021

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

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

Back to the top