Table setCollapsed does not work

Hi,
I used the method – setCollapsed(true) to set table column visible dynamically,but it doesn’t work.
Why? What else do I need to do?
Thanks!

Hi,

Actually, it should work without any additional actions:

customersTable.getColumn("email").setCollapsed(true);

Could you please share your XML descriptor and Java controller code of the screen, to see if there any problems or intersections?

Thanks for you reply.
image
image
image
I added a list of workStation to the porduction line edit page.The produciton line has A an B,two operation modes.Select mode A,the workOrder column is not displayed.Select mode B and the workOrder column is displayed on the page.
image
image
I tried many methods.but I couldn’t find the effective one.
Thanks!

Hi, @Yao7!

Your table has the columnControlVisible="false" attribute which means that column collapsing can’t be performed neither by UI nor programmatically. In case to only prevent users changing columns visibility by UI and allow managing columns visibility programmatically according to some conditions, I would recommend you to define a style name for your table and hide v-table-column-selector element by CSS.

Regards,
Gleb

1 Like