Iurii Dziuban
Iurii Dziuban

Reputation: 1091

Vaadin TreeTable Filtering

I use TreeTable with custom datasource. I want to filter it and expand items that match particular conditions. But the only method, that I found, is setCollapsed(itemId, collapsed) But using this method for great amount of items will break the performance. Any suggestions how can I solve this problem?

Upvotes: 1

Views: 2027

Answers (1)

user973999
user973999

Reputation:

You can add an SimpleStringFilter (or your own implementation of Filter) to the container of the treeTable (Vaadin API for more info).

Adding an filter to a container will retains only the matching item in the container data source (the Container.getItemsIds().size() will return the exact number of matching items).

After that you can use the setCollapsed() method with fewer items.

Regards.

Upvotes: 1

Related Questions