ColumnOverrideAccumulator to ColumnGroupHeaderLayer or ColumnGroupGroupHeaderLayer [message #1705542] |
Mon, 17 August 2015 08:46  |
Eclipse User |
|
|
|
I am using 2 level Column Grouping using ColumnGroupGroupHeaderLayer and ColumnGroupHeaderLayer
In colummnGroupHeaderLayer.addColumnIndexesTo Group("groupName1", 1,2,3);
In the above line instead of hardcoding given some unique identifier for groupName1 and overriden the method getDataValueByPosition()in columnGroupHeaderLayer to iterate the list based on columnPosition and return value.(this is the value of the actual groupName1).
What is happening is
Since over ViewPort layer our columnGroupLayer is used, everytime i scroll columnPosition changes so everytime columnGroupHeaderLayer . getDataValueByPosition() is called , so as i scroll column group Header layer cell value is changing.
To Solve this, i used
i) i override the method getConfigLabelsByPositionin ColumnGroupHeaderLayer
LabelStack result = super.getConfigLabelsByPosition(columnPosition, rowPosition);
int columnIndex = getColumnIndexByPosition(columnPosition);
int rowIndex = getRowIndexByPosition(rowPosition);
if (rowIndex == 0 && this.isColumnInGroup(columnIndex)) {
result.add("LABEL");
}
Also i did
IConfigLabelAccumulator cellLabelAccumulator = new IConfigLabelAccumulator() {
@Override
public void accumulateConfigLabels(LabelStack configLabels,int columnPosition, int rowPosition) {
int columnIndex = columnGroupHeaderLayer.getColumnIndexByPosition(columnPosition);
int rowIndex = columnGroupHeaderLayer.getRowIndexByPosition(rowPosition);
if (rowPosition==0) {
configLabels.addLabel("COLUMN_GROUP_HEADER");
}
}
}
};
Both dint work
How to solve this issue?
|
|
|
|
Re: ColumnOverrideAccumulator to ColumnGroupHeaderLayer or ColumnGroupGroupHeaderLayer [message #1706141 is a reply to message #1705561] |
Mon, 24 August 2015 03:23  |
Eclipse User |
|
|
|
It seems you don't understand the basic mechanics of NatTable. And I don't understand why people are overriding internal methods when they haven't understood whats happening internally.
First, from what I can see from your post I assume you don't know about the index-position transformation. Therefore the values are changing on scrolling.
Second, why should setting a label help regarding the cell content. One of the main concepts is to separate content and rendering. Therefore your solution to solve your self-produced issue is simply wrong.
|
|
|
Powered by
FUDForum. Page generated in 0.04560 seconds