O'Reilly logo

Vaadin 7 UI Design By Example Beginner's Guide by Alejandro Duarte

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Collapsing and reordering columns

You can allow users to hide or show columns at runtime. All you have to do is to enable column collapsing:

    table.setColumnCollapsingAllowed(true);

That will render a little menu to play with columns' visibility as shown in the next screenshot:

Collapsing and reordering columns

If you want to disable column collapsing for a certain column, you can do something similar to the following code snippet:

    table.setColumnCollapsible("A + B", false);

Tip

You have to call table.setColumnCollapsingAllowed(true); when you want some columns to be noncollapsible. If you don't make this call, the menu showing the columns won't be rendered. You can use the setColumnCollapsed ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required