Vaadin网格 - 使用延迟加载进行过滤 [英] Vaadin grid - filtering with lazy loading

查看:171
本文介绍了Vaadin网格 - 使用延迟加载进行过滤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有vaadin网格,从框中加载延迟数据非常棒。但由于某些原因,我有自定义过滤器,我使用

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(查询查询)

查询对象具有按部分加载的参数( offset limit ),所以我需要动态设置它(?)并以某种方式监听网格滚动事件以在用户时加载下一部分数据向下滚动(?)

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 有字段范围pushRows 但是没有公共方法可以获得它。我所拥有的只是延迟加载的网格,没有过滤数据或带有过滤数据的热切加载网格。

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.

那么,是否有任何方法可以实现延迟加载的过滤数据vaadin网格元素?

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

推荐答案

确定,使用 ConfigurableFilterDataProvider<> 作为包装在上的CallbackDataProvider<>
所以,当我过滤表时,这个包装器会为所有查询添加过滤条件,并且数据会像往常一样加载延迟。

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.

这篇关于Vaadin网格 - 使用延迟加载进行过滤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆