Grid Helpers Add-on
Several grid recipes for Vaadin 23+ (and 22), ready to use
Several grid recipes for Vaadin 23+ (and 22), ready to use. DOES NOT require extending Grid.
Features
- Remove multiselect selection column
- Freeze a grid's selection (checkbox) column
- Create Grid with conditional selection (with the following limitations: #11, #12)
- Select Grid rows automatically using up/down arrow keys
- Show a Vaadin Grid with compact row styling
- Show a meaningful message instead of an empty Grid
- Show a menu to toggle the visibility of grid columns
Sample code
Grid<Person> grid = new Grid<>(); grid.setItems(TestData.initializeData()); grid.setSelectionMode(SelectionMode.MULTI); grid.addColumn(Person::getFirstName).setHeader("First name"); grid.addColumn(Person::getLastName).setHeader("Last name"); grid.addColumn(Person::getTitle).setHeader("Title"); grid.addColumn(Person::getCountry).setHeader("Country"); grid.addColumn(Person::getCity).setHeader("City"); grid.addColumn(Person::getStreetAddress).setHeader("Street Address"); grid.addColumn(Person::getPhoneNumber).setHeader("Phone Number"); grid.getColumns().forEach(c -> c.setAutoWidth(true)); GridHelper.setSelectionColumnFrozen(grid, true);
Grid<Person> grid = new Grid<>(); grid.setItems(TestData.initializeData()); grid.setSelectionMode(SelectionMode.MULTI); grid.addColumn(Person::getFirstName).setHeader("First name"); grid.addColumn(Person::getLastName).setHeader("Last name"); grid.addColumn(Person::getCountry).setHeader("Country"); GridHelper.setSelectionColumnHidden(grid, true);
Grid<Person> grid = new Grid<>(); grid.setItems(TestData.initializeData()); grid.setSelectionMode(SelectionMode.MULTI); grid.addColumn(Person::getFirstName).setHeader("First name"); grid.addColumn(Person::getLastName).setHeader("Last name"); grid.addColumn(p -> p.isActive() ? "Yes" : "No").setHeader("Active"); GridHelper.setSelectionFilter(grid, Person::isActive);
Grid<Person> grid = new Grid<>(); grid.setItems(TestData.initializeData()); grid.setSelectionMode(SelectionMode.MULTI); grid.addColumn(Person::getFirstName).setHeader("First name"); grid.addColumn(Person::getLastName).setHeader("Last name"); grid.addColumn(Person::getCountry).setHeader("Country"); GridHelper.setSelectOnClick(grid, true);
Grid<Person> grid = new Grid<>(); grid.setItems(TestData.initializeData()); grid.setSelectionMode(SelectionMode.SINGLE); grid.addColumn(Person::getFirstName).setHeader("First name"); grid.addColumn(Person::getLastName).setHeader("Last name"); grid.addColumn(Person::getCountry).setHeader("Country"); GridHelper.setArrowSelectionEnabled(grid, true);
Grid<Person> grid = new Grid<>(); grid.setItems(TestData.initializeData()); grid.setSelectionMode(SelectionMode.SINGLE); grid.addColumn(Person::getFirstName).setHeader("First name"); grid.addColumn(Person::getLastName).setHeader("Last name"); grid.addColumn(Person::getCountry).setHeader("Country"); grid.addThemeName(GridHelper.DENSE_THEME);
Grid<Person> grid = new Grid<>(); grid.setItems(TestData.initializeData()); Column<Person> firstNameColumn = grid.addColumn(Person::getFirstName).setHeader("First name"); Column<Person> lastNameColumn = grid.addColumn(Person::getLastName).setHeader("Last name"); Column<Person> countryColumn = grid.addColumn(Person::getCountry).setHeader("Country"); GridHelper.setHidingToggleCaption(firstNameColumn, "First name"); GridHelper.setHidingToggleCaption(lastNameColumn, "Last name"); GridHelper.setHidingToggleCaption(countryColumn, "Country"); GridHelper.setColumnToggleVisible(grid, isVisible());
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
Initial release. Compatible with Vaadin 22-23.
- Released
- 2022-04-07
- Maturity
- EXPERIMENTAL
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 22
- Vaadin 23
- Vaadin 24 in 1.3.2
- Browser
- Firefox
- Safari
- Google Chrome
- iOS Browser
- Android Browser
- Microsoft Edge
Grid Helpers Add-on - Vaadin Add-on Directory
Several grid recipes for Vaadin 23+ (and 22), ready to useOnline Demo
Issue tracker
View on GitHub
Grid Helpers Add-on version 0.1.0
Initial release. Compatible with Vaadin 22-23.
Grid Helpers Add-on version 0.2.0
#### New features:
- Add support for toolbar footer ([#15](https://github.com/FlowingCode/GridHelpers/issues/15))
- Add support for obtaining headers and footers
- Implement setHidable and default toggle caption
Grid Helpers Add-on version 0.2.1
#### Bug fixes:
* Fix column toggle items style (Items to toggle column visibility do not respond on full width) ([#24](https://github.com/FlowingCode/GridHelpers/issues/24))
* Prevent ColumnToggle from closing after selection ([#25](https://github.com/FlowingCode/GridHelpers/issues/25))
Grid Helpers Add-on version 0.3.0
#### New features:
* Add listener for column visible toggle ([#27](https://github.com/FlowingCode/GridHelpers/issues/27))
Grid Helpers Add-on version 0.3.1
### Bugfixes:
* Fix NPE when trying to obtain a missing footer (fixes [#31](https://github.com/FlowingCode/GridHelpers/issues/31))
Grid Helpers Add-on version 0.3.2
#### Bug fixes:
* fix: remove JSR 380 annotations ([#44](https://github.com/FlowingCode/GridHelpers/issues/44))
* fix: support vaadin getHeader/getFooter ([#33](https://github.com/FlowingCode/GridHelpers/issues/33))
* fix: support Vaadin 24 DOM structure by ([#47](https://github.com/FlowingCode/GridHelpers/issues/47))
Grid Helpers Add-on version 0.3.3
#### Bug fixes:
* fix: allow setting grid footer toolbar over an existing one ([#50](https://github.com/FlowingCode/GridHelpers/issues/50))
Grid Helpers Add-on version 0.3.4
#### Bug fixes:
* keep original selection when clicking a non-selectable row ([#40](https://github.com/FlowingCode/GridHelpers/issues/40))
* fix binary incompatibility with Vaadin 24 ([#54](https://github.com/FlowingCode/GridHelpers/issues/54))
Grid Helpers Add-on version 0.3.5
#### New features:
* Add enhanced support for grid rows selection ([#13](https://github.com/FlowingCode/GridHelpers/issues/13))
Grid Helpers Add-on version 1.0.0
#### New features:
* Add enhanced support for grid rows selection ([#13](https://github.com/FlowingCode/GridHelpers/issues/13))
* New major version compatible with Vaadin 23.3 and 24
Grid Helpers Add-on version 1.1.0
#### New features:
* add feature for hiding header and footers ([#14](https://github.com/FlowingCode/GridHelpers/issues/14))
* add support for styling headers and footers
* add support for heightByRows
* add support for responsive steps
#### Bug fixes:
* support Enhanced, Selection by clicking row and Arrow selection simultaneously ([#64](https://github.com/FlowingCode/GridHelpers/issues/64))
* initialize connector if the grid is already attached ([#76](https://github.com/FlowingCode/GridHelpers/issues/76))
Grid Helpers Add-on version 1.1.1
#### New features:
* add feature for hiding header and footers ([#14](https://github.com/FlowingCode/GridHelpers/issues/14))
* add support for styling headers and footers
* add support for heightByRows
* add support for responsive steps
Grid Helpers Add-on version 1.2.0
#### New features:
* Add select all support for grids using a lazy data provider ([#70](https://github.com/FlowingCode/GridHelpers/issues/70))
#### Bug fixes:
* Style toggle menu for Vaadin 24 ([#75](https://github.com/FlowingCode/GridHelpers/issues/75))
* Allow to add a footer to a one-column grid ([#90](https://github.com/FlowingCode/GridHelpers/issues/90))
Grid Helpers Add-on version 1.3.0
#### New features:
* Add checkbox column helper ([#69](https://github.com/FlowingCode/GridHelpers/issues/69))
Grid Helpers Add-on version 1.3.1
#### Bug fixes:
* fix empty grid label not shown ([#102](https://github.com/FlowingCode/GridHelpers/issues/102))
* fix style of first line in dense grid ([#101](https://github.com/FlowingCode/GridHelpers/issues/101))
* set vaadin dependency as optional
Grid Helpers Add-on version 1.3.2
#### Bug fixes:
* add support to clear empty grid label ([#103](https://github.com/FlowingCode/GridHelpers/issues/103))
* fix steps array values should be ascending sorted ([#93](https://github.com/FlowingCode/GridHelpers/issues/93))