EXTJS 학습노트---EXTJs의 확인란이 있는tree, 부모 노드를 선택할 때 모든 하위 노드가 선택됨

3491 단어 ExtJs

 //  , 
               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);   


 




제2종

'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);
                       });   
                   }     
              });            
           }        
      });                    
   }

좋은 웹페이지 즐겨찾기