Dynamical Loading mode allows to load data not all at once, but partially, by client-side request. It decreases initial loading time and loading of server.
To work correctly, on client-side should be enabled related mode:
To activate the mode you should use the method dynamic_loading():
$grid->dynamic_loading([$rowsNum]);
Normally, connector makes all operations automatically, and doesn't need customization.
But, in case of dynamic loading in tree/treeGrid, database can contain field indicated leaf or branch the current item is.
In beforeRender event handler you are allowed to mark an item as a leaf or branch (it decreases a number of SQL queries and increases perfomance).
function custom_define($item){ if ($item->get_value("is_a_branch")) $item->set_kids(true); else $item->set_kids(false); } $tree->event->attach("beforeRender","custom_define");
The same approach can be used for non-dynamical mode of tree/treeGrid as well. It's not obligatory but lets you increase data generation performance.