Hi all,
below is my scenario
I am loading all the tree nodes children on demand(on nodeExpanding event). My requirement is, if user selects the parent node checkbox first & expands the node later all the child node checkboxs should be selected automatically without triggering nodeCheckstateChanging or nodeCheckstateChanged event(in these events we have written some server action) .
I tried option in below url. this invokes nodeCheckstateChanging or nodeCheckstateChanged event .
is there any way to disable & enable events or any other way to achieve this ?
http://es.infragistics.com/community/forums/t/91434.aspx
Hello Raghu,
Thank you for posting in our community.
I can suggest using the ‘triState’ checkboxMode as it seems to match your requirements. You won’t need to do anything else to have newly loaded children match the parent selection state as it will “cascade up and down in this mode”. //Initialize
$(".selector").igTree({
checkboxMode : "triState"
//…
});
Also no additional events are triggered by this functionality. I’ve made a quick sample demonstrating that: http://jsfiddle.net/damyanpetev/d3q1qzvo/
Let me know if this resolves your issue and don’t hesitate to ask if you need any further assistance.
Regards,
Damyan Petev
Software Developer
Infragistics, Inc.
Hi Damyan ,
Thanks for response.
we are already using igtree with checkboxMode : "triState" , but we are loading child nodes in nodeExpanding event using custom code, we are not using loadOnDemand property. below is the code which we are using to load nodes dynamically.
is it possible to get the behavior as in above shared example(using loadOnDemand ) using below approach.
self.loadEDMTree = function (data, hierarchy, parentPath, parentText) {
if (parentPath) { var parentNode = $("#edmTree").igTree("nodeByPath", parentPath); var loadingNodePath = parentPath + ".0"; $("#edmTree").igTree("removeAt", loadingNodePath); for (var i = 0, len = data.length; i < len; i++) { $("#edmTree").igTree("addNode", data[i], parentNode); } $("#edmTree").igTree("expand", parentNode); } else { self.edmTreeData(data); }
};