Add new generated column ordered first

Hi!

In an existing table I want to add an additional generated column and I would like it to be placed first/outer-left of all the columns in the table.

I don’t know how to achieve this. Is there a way to index the column when it’s added or is there a way to re-order it programmatically once it’s added?

Thankful for any help!

/Max

I don’t know offhand if this will fix the problem, but have you tried calling table.setVisibleColumns() after you add the generated table?

See
section 5.14.5 of the Book of Vaadin
for more info.

Cheers,
Bobby

I posted this on Stack Overflow as well and someone posted this as the answer, worked out well for me:

What you should do is to set your

table.setVisibleColumns(your sorted order of columns)

and also

table.setColumnReorderingAllowed(false) 

it might be good to throw in a force of relaoding the datasource so

table.setContainerDataSource(table.getContainerDataSource());