Hi,
i have a tree with multiple levels and some sometimes don’t contain childs. I try to use the set_kids method as described in the documentation in a before_render custom function (debug msg included):
[code]function check_leaf($item){
if ($item->get_value(“ITEM_TYPE_ID”)==“100”) {
$item->set_kids(false);
$item->set_value(“ITEM_NAME_T”, “ITEM_TYPE_ID 100”);
} else {
$item->set_kids(true);
$item->set_value(“ITEM_NAME_T”, “ITEM_TYPE_ID != 100”);
}
}
$tree->event->attach(“beforeRender”,“check_leaf”);
[/code]
With the debug msg i see that everything works but the image on the rendered tree is still wrong and still a click able folder even for the set_kids=false branch.
Here is an example of a xml result that should have set_kids=false, the text is changed as expected but still is shown in the tree like it has childs. I tried different dynamic loading settings but always the same result.
<tree id="5#510">
<item id="6#764" text="ITEM_TYPE_ID 100" child="1"/>
<item id="6#765" text="ITEM_TYPE_ID 100" child="1"/>
</tree>
Any idea what i am doing wrong?
Thank you