Problem with Column Group Reorder and Column Grouping by Value [message #1799426] |
Thu, 06 December 2018 16:33 |
Yves Prelot Messages: 13 Registered: September 2016 |
Junior Member |
|
|
Hello,
I have found it difficult to configure a table using both Column group reorder and Column grouping by value.
Using the default configuration, the group by feature works well, but the column reorder is broken : groups can be broken into sections and you can move a column which is in a group to another place : it still stays inside the group, but the group itself is broken (instead of being continuous, it is broken into separate segments...)
After a long investigation, I believe there is a conflict between:
DefaultColumnGroupHeaderLayerConfiguration => configureUiBindings
which does what is expected for proper Group Column Reorder
and
GroupByHeaderConfiguration => configureUiBindings
which does what is expected for Column Grouping by Value
I could (almost) do what I wanted by extracting the code for the latter (a simple registerFirstMouseDragMode) and assigning it to a different key (left clisck + MOD2);
this is not very natural but is acceptable.
Is there a smarter way to do this ?
Here is a snipet showing what I did:
groupByHeaderLayer = new GroupByHeaderLayer(groupByModel, gridLayer, columnHeaderDataProvider,
new GroupByHeaderConfiguration(groupByModel, columnHeaderDataProvider, columnHeaderStack.columnHeaderLayer) {
DefaultColumnGroupHeaderLayerConfiguration defaultConf = new DefaultColumnGroupHeaderLayerConfiguration(
columnGroupModel);
@Override
public void configureRegistry(IConfigRegistry configRegistry) {
defaultConf.configureRegistry(configRegistry);
super.configureRegistry(configRegistry);
}
@Override
public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
// everything for columns work here, but column group by
defaultConf.configureUiBindings(uiBindingRegistry);
// add the column group by
uiBindingRegistry.registerFirstMouseDragMode(MouseEventMatcher.columnHeaderLeftClick(SWT.MOD2),
new AggregateDragMode(new CellDragMode(), new GroupByColumnReorderDragMode(), new GroupByDragMode()));
}
});
Regards,
Yves
[Updated on: Thu, 06 December 2018 16:43] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03821 seconds