Create TreeGrid with dynamic loading when paging and opening nodes


#1

Hey there.

I don’t get it working. Maybe it is just not possible…
In my current project I use a dhtmlxGrid with dynamic loading (via dhtmlxConnector) and bricks paging. Works well as intended.

Now I added a column parentID to the related database table to create a simple parent > child hierarchy. The perfect solution would be:

  • Using dynamic loading for opening nodes (working with kidsXml, right?)
  • Keep using dynamic loading for paging (reload next bunch of data on demand)

Important: the maxium depth is 1. Parent > children (no more levels).

The base dhtmlxTreeGrid should hold all Items without a parentID set (db value = NULL) and clicking the “+” should dynamically load and show all child rows.

Would help so much, if there is a dhtmlxConnector based solution for that.
Thanks in advance!


#2

The only solution for the dynamic loading in treegrid is a “xml kids” solution: initially only the root level of the treegrid is loaded and rendered. Opening the item containing the child nodes will trigger these nodes to load and render.
Here you can find a tutorial:
https://docs.dhtmlx.com/treegrid__manipulating_data.html#dynamicloadingintreegrid
and a working example:
https://dhtmlx.com/docs/products/dhtmlxTreeGrid/samples/01_initialization_loading/01_treeGrid_dynamic.html