TreeGrid how to avoid refleshAll when insert od deleting was in the middle

Hi all, during my work with TreeGrid I have some difficulties with refreshing items.

I have a grid with many nested child items with complex hierarchy, when I try to insert a new row between other expanded child rows of one parent, I do refreshItem (parent, all), but after this, I see many empty rows behind the newly created row, and when I click on these empty lines, the lines in the next row are also selected, it seams they are duplicates of the same row, TreeGrid has Single select mode. Only refresh all helps to remove empty lines. Same issue with deleting rows between other children of one parent.

How to avoid refreshAll ()? This is a real problem because in case the user removes a row in the end of grid after refreshing all he is on top of the grid. ScrollTo (index) doesn’t work after calling refreshAll ().

The difference between refreshAll and refreshItem is really related to this. If you add/remove items, you need to allways use refreshAll instead of refreshItem, since the later is meant only for updating the specific item, nothing more.

top of the grid. ScrollTo (index) doesn’t work after calling refreshAll ()

This is however a bug

See: https://github.com/vaadin/vaadin-grid/issues/1889 and https://github.com/vaadin/vaadin-grid/issues/2107

It is currently being investigated.

Tatu Lund:
The difference between refreshAll and refreshItem is really related to this. If you add/remove items, you need to allways use refreshAll instead of refreshItem, since the later is meant only for updating the specific item, nothing more.

top of the grid. ScrollTo (index) doesn’t work after calling refreshAll ()

This is however a bug

See: https://github.com/vaadin/vaadin-grid/issues/1889 and https://github.com/vaadin/vaadin-grid/issues/2107

It is currently being investigated.

Thanks for the answer :slight_smile:

Previously I worked with vaadin 7, I used TreeTable component, there rows update looks very quiet, in vaadin 14 refreshes happens very dynamically, all items move in the table, after seeing such an update I often forget what I wanted to do next in the table, It’s embarrassing me.

Is it possible to do refreshes more smooth? :slight_smile:

One related ticket about improvement is here:

https://github.com/vaadin/vaadin-grid/issues/2109