Hello,
is it possible to load Tree from SQL and check the nodes according to a value of an SQL field?
e.g.
$tree->render_sql("select id,displaytext,parentnode,ischecked","id","displaytext","","parentnode")
Thank you
Hello,
is it possible to load Tree from SQL and check the nodes according to a value of an SQL field?
e.g.
$tree->render_sql("select id,displaytext,parentnode,ischecked","id","displaytext","","parentnode")
Thank you
Hello,
Yes, you use beforeRender event. Here is the related information:
docs.dhtmlx.com/doku.php?id=dhtm … re_loading
docs.dhtmlx.com/doku.php?id=dhtm … eedataitem
[code]
function formatting($item){
$item->set_check_state($item->get_value(“ischecked”));
}
$tree = new TreeConnector($res);
$tree ->event->attach(“beforeRender”,“formatting”);
$tree->render_sql(“select id,displaytext,parentnode,ischecked”,“id”,“displaytext”,“ischecked”,“parentnode”);[/code]
Thanks a lot