Ordering columns in GroupTable

Hi,

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

Thanks

Hello!

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.

Hi,

Thank you, this way is working.

Regards

Hi,
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 ??

Regards,
Martin

Hello,

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();

Hello,
Thank you.
It works perfect.

Regards