Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reflect PagedDataProvider update for Vaadin 8 #24

Merged
merged 1 commit into from Feb 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 15 additions & 8 deletions README.md
Expand Up @@ -117,18 +117,19 @@ model.setMode(TableSelectionMode.SIMPLE);
grid.setSelectionModel(model);
```

Using the PagedContainer needs an existing Indexed container to wrap:
Using the PagedDataProvider:

```java
// This is your existing container
Container.Indexed myContainer;
PagedContainer container = new PagedContainer(myContainer);
Grid grid = new Grid(container);
// This is your existing data
PagedDataProvider<?> dataProvider = new PagedDataProvider<>(
DataProvider.ofCollection(data));
Grid grid = new Grid();
grid.setDataProvider(dataProvider);

// PagedContainer has a helper class for page manipulation
// PagedDataProvider has a helper class for page manipulation
PagingControls controls = container.setGrid(grid);

// Set container (and grid with it) to certain size
// Set grid to certain size
controls.setPageLength(5);

// Jump to fourth page (0-based indexing)
Expand All @@ -148,7 +149,13 @@ TableSelectionModel gives you client-side selection UX similar
to Table. It supports Multiple selection in simple mode and with ctrl +
click.

### PagedContainer
### PagedDataProvider

A simple data provider wrap. Works through paging and provides its own PagingControls for a cleaner API.

This does not work with Table.

### PagedContainer (Vaadin 7.x only)

A simple Container wrap on top of any indexed container. Works through
paging and provides its own PagingControls for a cleaner API.
Expand Down