2

I am using Vaadin8 Grid with Multi Selection. I want to implement an option to hide a row or unhide row in the Grid.

Has any one already implemented this feature? Appreciate if i get some pointers on how to implement it feature.

TIA

SDS
  • 457
  • 5
  • 17
  • WHat do you mean by hide/unhide? Remove it from the data backend? How will you unhide it, when it's not visible any longer? – André Schild Aug 03 '18 at 15:56
  • The row should not be visible in the UI but available in the data backend and Unhide would be an action to show all the hidden rows. – SDS Aug 03 '18 at 16:08
  • 1
    This would be feature similar to Column Hide and Show All Columns – SDS Aug 03 '18 at 16:17

1 Answers1

3

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. 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? Which has code example of filtering. Usually Lambda expressions are used as filters. 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.

Tatu Lund
  • 9,949
  • 1
  • 12
  • 26
  • Thank you for the information. I was able to use filters to hide row and show all rows. – SDS Aug 06 '18 at 22:57