The column visibility toggler is a common feature for datatable.
Is it possible to add this feature in vaadin-grid or add an example of code to create a column toggler?
There are few problems or missing features: (if you have a simple solution for these, please comment this ticket)
- no hideable attribute for a column (you cannot configure this easily for your custom toggler)
- no getHeaderText or getHeader to display a label for each column in the column visibility toggler
- a non visible column is different than having a column removed. (from the Column.setVisible Note that column related data is sent to the client side even if the column is invisible. Use {@link Grid#removeColumn(Column)} to remove column (or don't add the column all) and avoid sending extra data.). So if you have a lot of hidden columns, the grid could be slow down because of the hidden columns.
Here one forum post: https://vaadin.com/forum/thread/17131429/set-hidable-and-hidden-columns-in-grid
The column visibility toggler is a common feature for datatable.
Is it possible to add this feature in vaadin-grid or add an example of code to create a column toggler?
There are few problems or missing features: (if you have a simple solution for these, please comment this ticket)
Here one forum post: https://vaadin.com/forum/thread/17131429/set-hidable-and-hidden-columns-in-grid