简体   繁体   English

Vaadin 8 Grid:隐藏/取消隐藏选定的行

[英]Vaadin 8 Grid : hide/unhide selected row

I am using Vaadin8 Grid with Multi Selection. 我正在使用Vaadin8 Grid with Multi Selection。 I want to implement an option to hide a row or unhide row in the Grid. 我想实现一个选项来隐藏Grid中的行或取消隐藏行。

Has any one already implemented this feature? 有没有人已经实现了这个功能? Appreciate if i get some pointers on how to implement it feature. 如果我得到关于如何实现它的功能的一些指示,请感谢。

TIA TIA

The correct way to implement selective display Grid rows is to use Filtering in DataProvider For example the ListDataProvider, which is used by Grid has API's for filtering. 实现选择性显示网格行的正确方法是在DataProvider中使用过滤例如,Grid使用的ListDataProvider具有用于过滤的API。 So items passing the filters are shown, and those which are not passing the filters are not shown. 因此显示了通过过滤器的项目,并且未显示未通过过滤器的项目。

There is another question about Filtering with Grid here at StackOverflow: How to add grid filters in Vaadin 8? 在StackOverflow上还有另一个关于使用网格过滤的问题: 如何在Vaadin 8中添加网格过滤器? Which has code example of filtering. 其中有过滤的代码示例。 Usually Lambda expressions are used as filters. 通常Lambda表达式用作过滤器。 You can create custom filters. 您可以创建自定义过滤器。 For example in your case you could have list of ids in the filter, and filter out rows that match those ids. 例如,在您的情况下,您可以在过滤器中包含ID列表,并过滤掉与这些ID匹配的行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM