日期:2014-05-16 浏览次数:20352 次
// 当选中父节点时,让其子节点相应选中 contacterTree.on('checkchange', function(node, checked) { node.expand(); node.attributes.checked = checked; node.eachChild(function(child) { child.ui.toggleCheck(checked); child.attributes.checked = checked; child.fireEvent('checkchange', child, checked); }); }, contacterTree);
'checkchange' : function(node, checked) { win.treepnl.suspendEvents(false); //后加的树展开选中函数,存在递归调用,有待提取。 node.expand(); node.attributes.checked = checked; node.eachChild(function(child) { child.ui.toggleCheck(checked); child.attributes.checked = checked; child.fireEvent('checkchange', child, checked); if(child.hasChildNodes()){ child.expand(); child.eachChild(function(childs) { childs.ui.toggleCheck(checked); childs.attributes.checked = checked; childs.fireEvent('checkchange', childs, checked); if(childs.hasChildNodes()){ childs.expand(); childs.eachChild(function(childss) { childss.ui.toggleCheck(checked); childss.attributes.checked = checked; childss.fireEvent('checkchange', childss, checked); }); } }); } });
'checkchange' : function(node, checked) { win.treepnl.suspendEvents(false); //后加的树展开选中函数,存在递归调用,有待提取。 node.expand(); node.attributes.checked = checked; node.eachChild(function(child) { child.ui.toggleCheck(checked); child.attributes.checked = checked; child.fireEvent('checkchange', child, checked); if(child.hasChildNodes()){ child.expand(); child.eachChild(function(childs) { childs.ui.toggleCheck(checked); childs.attributes.checked = checked; childs.fireEvent('checkchange', childs, checked); if(childs.hasChildNodes()){ childs.expand(); childs.eachChild(function(childss) { childss.ui.toggleCheck(checked); childss.attributes.checked = checked; childss.fireEvent('checkchange', childss, checked); }); } }); } }); }