Vaadin grid - filtering with lazy loading

佐手、 提交于 2019-12-08 05:43:51

问题


I have vaadin grid, and it's great that it has lazy data loading from the box. But for some reasons I have custom filters, which I use via

CallbackDataProvider<> dataProvider.fetch(Query query)

Query object has parameters for loading by portions (offset and limit), so I need to set it dynamically (?) and somehow listen grid scrolling event to load next part of data when user scrolls down (?)

Grid.dataComunicator has field Range pushRows but there no public methods to get it. And all i have is grid with lazy loading without filtered data or grid with eager loading with filtered data.

So, is there any way to implement filtering data with lazy loading in vaadin grid element?


回答1:


ok, problem solved by using ConfigurableFilterDataProvider<> as wrapper over CallbackDataProvider<>. so, when i filter table, this wrapper adds filtering conditions to all queries, and data loads lazy as usual.



来源:https://stackoverflow.com/questions/44972970/vaadin-grid-filtering-with-lazy-loading

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!