pagination in grid view

I have a gird view that contains the item, but I would like to create paginations in the gird view.
Can you please help how to create Paginations in vaadin framework v10

I would really love to see this feature in Grid Component, since imho it’s basic functionality that almost everybody needs. But there isn’t even a Plugin for this. I’m afraid you have to implement it yourself.

What I did for my Grid is implementing the AbstractBackEndDataProvider. You can find an example here: [https://vaadin.com/docs/v10/flow/binding-data/tutorial-flow-data-provider.html]
(https://vaadin.com/docs/v10/flow/binding-data/tutorial-flow-data-provider.html) It’s just above the Chapter “Refreshing”.
Now you can build your own Pagination Component that keeps track of your current Index. The number of pages available, the number of items per page and so on. With this information you can get the relevant items from the DataProvider and replace the items in your grid with setItems-Method.

Maybe this could help you a little bit. I’m eager to see a better suggestion.

Thank you very much Oliver for your reply, would it be possible for you if you may share the code snippit how did you implemented the pagination?

Hi Amit, I didn’t yet implement the Pagination, since it’s not my priority right now. But I’ve spent some time thinking about how I’ll probably do it. You could get some ideas on how to implement the Pagination from the Pagination Addon for earlier Vaadin versions. Like this: [https://github.com/basakpie/vaadin-pagination-addon]
(https://github.com/basakpie/vaadin-pagination-addon)

Hi Oliver,
The dependancy you mentioned I have tried it already 2 days ago but it didn’t not work, it was not able to find out some classes with vaadin version 10.
Nevertheless, As you suggested to create own pagination, I have created my own Pagination classes.
Thank you very much @Oliver for your suggestions.