Automatically check/uncheck all subtree nodes in extjs tree when certain node gets checked/unckecked

穿精又带淫゛_ 提交于 2019-11-30 13:22:35

问题


How do I automatically check/uncheck all subtree nodes in an extjs tree when a certain node gets checked/unckecked. I already have my tree with checkboxes. The only thing missing is this check/unckeck behavior. I found this: check child nodes of a tree when a parent is clicked [ExtJS] , but it doesn't work for me because the the extjs API seems to be changed.


回答1:


I found a solution:

oncheckchange = function(node, checked, options){
    node.cascadeBy(function(n){n.set('checked', checked);} );
};

tree.on('checkchange', oncheckchange, null);


来源:https://stackoverflow.com/questions/6579769/automatically-check-uncheck-all-subtree-nodes-in-extjs-tree-when-certain-node-ge

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!