By using TreeMultitableConnector/TreeGridMultitableConnector instead of TreeConnector/TreeGridConector you can load data from multiple tables.
require("../../codebase/treemultitable_connector.php");
$tree = new TreeMultitableConnector($res);
$tree->setMaxLevel(3);
$level = $tree->get_level();
For more details see 'TreeMultitableConnector/TreeGridMultitableConnector' guide.
By using TreeGroupConnector/TreeGridGroupConnector instead of TreeConnector/TreeGridConector you can load data from a table that doesn't contain therelation field.
require("./codebase/connector/tree_group_connector.php");
$tree = new TreeGroupConnector($res);
$tree->render_table("products2", "id", "product_name", "", "category");
For more details see 'TreeGroupConnector/TreeGridGroupConnector' guide.
In the beforeRender event handler you are allowed to mark an item as a leaf or a branch. For this purpose you should use the set_kids() method. As the input parameter true or false must be specified. true marks an item as a branch, false - as a leaf.
$item->set_kids(false);
For more details see 'Tree/TreeGrid Specificity' chapter in 'Dynamic loading' guide.
Back to top