I'm trying to place a checkbox inside dijit.Tree by entering input html code as part of label value. And it displays ok but I can't check or uncheck it. As if click events are not bubbling/reaching input element.
Here is how I create my tree object.
myTree = new dijit.Tree({
model: myModel,
showRoot: false,
getLabel: function(item) {
if (!item.root)
return '<input type="checkbox" name="'+ item.name +'" id="'+ item.name +'" value="1" /> '+ item.name;
}
}, "gridDiv");
How can I fix this ?
right now 2 choices come to my mind:
<div data-dojo-type="dijit.form.CheckBox" ... ></div>
and then after the tree's startup event do a dojo.parser.parse(tree.domNode)
. This will parse only your grid's DOM node and will convert any dojo style markup into actual dojo objects. I personally recommend, if you can, the first choice.
Luck,
I'd go with cbtree if I have check boxes in the tree. check here
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.