Ordering columns in GroupTable


I’m using a grouptable for displaying 16 columns. Now I need a flexible grouping
in this grouptable. I wrote code to group to on of three possible columns (or none of them).
So far so good, this is working.
The problem is now:
On every grouping the grouped column is jumping to the first place to the left.
This is ok. But on ungrouping this column stays on this position.
So after switching around between different groupings, my layout is compete destroyed.
I did not found a way to reorder the colums in the table to react to this behaviour and place column to her old place.

Is there a way to do this ?

My code-release is Cuba 7.2.12



Yes, the table does not provide the ability to reorder columns. To move a column in the table, you should remove it after ungrouping and add it by index again.


Thank you, this way is working.


have one more Question:
Is there a way to find out the existing column-Order in the moment?
I think, if you are iterating the table.getColumns() - list, you receive the original
order of the columns, not the order which the user has done for its own.
And the order, which cuba is storing in the user-setting ??



you can get the current column order using Vaadin table from unwrapped CUBA table:

com.vaadin.v7.ui.Table table = ordersTable.unwrap(com.vaadin.v7.ui.Table.class);
Object[] visibleColumnIds = table.getVisibleColumns();

Thank you.
It works perfect.