I am loading a tree from dhtmlXTreeFromHTML(treeDiv) which is using <item … /> data. I would ultimately like to 1) mark each item as ‘required’ somehow in the item xml, and 2) walk through the tree elements to perform work on the ‘required’ ones (ie. change the item image, maybe hide the checkbox, etc.)
Would you have a suggestion on how to approach this need? Thank you.
First, you can define custom images or checkbox state directly in item tags, while such initialization it possible to use all tags|attributes from tree’s XML ( please reffer to online documentation )
If you still want to do it by script, later, you can use userdata sections
true
and later in script
var z=(tree.getSubItems(0)).split(",")
for (var i=0; i<z.length; i++)
if (tree.getUserData(z[i],“required”))
do_something();