Does anybody know how to load the children data in the treegrid in the pagi

Because there are a lot of nodes under one node, I am considering load the children in the paging way.

I don’t really want to put so many nodes just in the memory, loading them from the BD in the paging way is a good idea.

Does anybody know how to do this? Could you provide some example code?

Thank you very much.

Hi,

take a look at the “Lazy Loading Hierarchical Data from a Back End” chapter in the docs here:
https://vaadin.com/docs/v8/framework/datamodel/datamodel-hierarchical.html

-Olli

Note, current implementation of lazy loading hierarchical data is not optimized, there is improvement under review process: https://github.com/vaadin/framework/pull/10378

Thanks for your reply.

Actualy I have tried this way. But the offset and the limit in the query object are always wrong. The offset keeps 0 and the offset are the Maxvalue of the integer.

It seems it doesn’t work.

Hi,

is there anything special one has to implement in order to get the lazy loading to work for TreeGrids? As Yuri, I am also stuck at the point where offset keeps 0 and limit is the maximum number of elements available (not maxvalue of integer, as the getChildCount method gets called properly).

I tried to figure out where the values are set for the query but lost track of it at some point.

Best regards