Advanced Grid - Vaadin Add-on Directory
Advanced Grid is a Vaadin Grid enhancement that adds built-in pagination and flexible data export capabilities.
# Advanced Grid
`advanced-grid` is a Vaadin add-on that wraps a standard Vaadin `Grid` and adds commonly needed “batteries included” features like:
- **Pagination UI** (page size chooser, navigation, optional page jump)
- **Export** (CSV/DOCX/HTML/ODS/ODT/PDF/PPTX/RTF/TEXT/XLSX via a pluggable exporter provider)
- **Convenient APIs** while still giving you access to the underlying Vaadin `Grid`
> The component is designed to **compose** a Vaadin `Grid`, so you can keep using normal Grid APIs and patterns.
---
## Demo / Running locally
Run the below command from the project root directory:
```
mvn spring-boot:run
```
Then open:
- `http://localhost:8080`
> If your environment uses a different port, check the Maven output for the actual URL/port.
## Installation
```xml
org.vaadin.addons.antlerflow
advanced-grid
${advanced-grid.version}
```
## Quick start
### Wrap an existing `Grid`
Use this when you already have a configured `Grid` (columns, renderers, selection, etc.):
```java
Grid
vaadinGrid = new Grid<>(Person.class);
AdvancedGrid grid = new AdvancedGrid<>(vaadinGrid);
```
### Create a new `AdvancedGrid`
```java
AdvancedGrid grid = new AdvancedGrid<>(Person.class);
// or
AdvancedGrid grid = new AdvancedGrid<>();
grid.getInnerGrid().addColumn(Person::getFirstName).setHeader("First Name");
grid.getInnerGrid().addColumn(Person::getLastName).setHeader("Last Name");
grid.getInnerGrid().addColumn(Person::getAge).setHeader("Age");
```
## Features
### Pagination
To enable pagination:
```java
grid.setPaginationVisibility(true);
```
To set default page size and size options:
```java
grid.setPageSizes(10, 20, 50, 100);
grid.setPageSize(20);
```
To customize paginator:
```java
grid.getPaginator().showPageSize(false);
grid.getPaginator().setHideEdges(true);
grid.getPaginator().showPageJump(false);
```
Add below css to make circly shaped pagination buttons:
```css
af-paginator::part(page-button) {
width: var(--af-paginator-control-height);
min-width: var(--af-paginator-control-height);
padding: 0;
border-radius: 9999px;
display: inline-flex;
align-items: center;
justify-content: center;
}
```
#### Spring Data Grid Integration
To integrate with Spring Data uses `SpringPageableDataProvider` as the data provider.
Example:
```java
PersonFilter personFilter = new PersonFilter();
SpringPageableDataProvider dataProvider =
new SpringPageableDataProvider<>((filter, pageable) -> personService.findAll(filter, pageable));
dataProvider.setFilter(personFilter);
advancedGrid.setDataProvider(dataProvider);
```
### Grid Export
AdvancedGrid uses [GridExporter for Vaadin](https://vaadin.com/directory/component/gridexporter-for-vaadin) as the default export provider.
#### Enable export
```java
grid.enableExport(true);
```
#### Configure export
```java
GridExportConfig exportConfig =
GridExportConfig.builder()
.fileName("people-report")
.size(ExportSize.ALL)
.formats(List.of("pdf", "xlsx", "csv"))
.limit(1000)
.build();
grid.setExportConfig(exportConfig);
// Below is an example of customizing the export title
grid.setExportHandler(
new XDEVSoftwareGridExportHandler<>() {
@Override
protected GridExporterProvider getProvider() {
return new PredefinedTitleProvider("Custom Title!");
}
});
```
The default export size is `ExportSize.CURRENT_PAGE`.
Tips:
- If you use `ExportSize.ALL`, ensure your backend/export limits are appropriate to avoid excessive memory usage.
- Prefer server-side paging for large datasets and export only what you actually need.
#### Customize the export button
```java
grid.getExportButton().setText("Export");
```
## License
Apache License 2.0 (see `LICENSE`).
View on GitHub
Advanced Grid version 1.0.0
# Advanced Grid – First Release (v1.0.0)
`advanced-grid` wraps the standard Vaadin `Grid` and adds commonly requested “batteries included” features such as built-in pagination and multi-format export — while preserving full access to the underlying `Grid` APIs.
---
## Highlights
### Pagination UI – Built In
No more building custom paginators from scratch.
- Page navigation controls
- Page size selector
- Optional page jump
- Customizable paginator behavior
- CSS part styling support
Designed to work seamlessly with:
- In-memory data providers
- Server-side paging
- Spring Data integration
---
### Multi-Format Export Support
Export grid data using a pluggable provider architecture.
Supported formats: CSV/DOCX/HTML/ODS/ODT/PDF/PPTX/RTF/TEXT/XLSX
Advanced Grid version 1.0.2
# Advanced Grid – Release (v1.0.2)
`advanced-grid` wraps the standard Vaadin `Grid` and adds commonly requested **“batteries included”** features such as built-in pagination and multi-format export — while preserving full access to the underlying Grid APIs.
---
## Bugfixes
- Cannot set property offset of `#` which has only a getter
Advanced Grid version 1.0.3
## Advanced Grid 1.0.3
**New**
- Column selection (`enableColumnSelection(true)`): users choose which columns to show, the choice is remembered, and Reset restores the defaults.
- Preference storage (`setColumnPreferenceStorage(...)`): browser local storage (default), session storage, database per user (`JdbcColumnPreferenceStorage`), in memory, or your own storage.
- Export selected rows: users choose all rows or only the selected ones; `ExportSize.SELECTED` always exports the selection.
**Changed**
- The Export button is enabled only when there is data (or a selection, for `SELECTED`).
- Toolbar buttons, including ones added with `addToActions(...)`, use the tertiary style and are evenly spaced.
- No extra space above or below the grid when the toolbar or paginator is empty.
Advanced Grid version 1.0.4
## Release Notes – Dependency Upgrades
### Updated Dependencies
- **Vaadin:** Upgraded to `25.3.4`
- **Spring Boot:** Upgraded to `4.1.2`
- **Vaadin Grid Exporter:** Upgraded to `4.0.2`