Call table column collapsed menu

Hello,

I like the table columns collapsable function. To simplify the usage it would be nice to open the menu with a button “Select visible columns” instead of clicking the small arrow in the table header.

Is it possible to open the column collapse menu programatically, i.e. by firing an event?

Thanks for your help
Rolf

Hey Rolf,

I don’t know if that particular menu can be shown programmatically. You can of course create your own menu (or whatever component(s) you find most suitable) and use/call the table’s setColumnCollapsed(…) to control which columns are collapsed.

In case someone is still interested in this: you could probably create an Extension that just sends an event to the correct DOM element (a div with the style name “v-table-column-selector” if I remember correctly) to open the menu. This requires a bit of client side coding, but should be doable with either a JavaScriptExtension or a Java Extension. See
https://vaadin.com/wiki/-/wiki/Main/Vaadin+7
and
https://vaadin.com/book/
for general information on developing client side code and extensions.

Meanwhile I use the ContextMenu addon to collapse/uncollapse my table columns and I hided the column selector arrow in the table header by CSS: .v-table-column-selector {height: 0px; width: 0px;}. This soultion works really fine for me.