EXT TREE CHECK

1614 단어 UIjspext
var Tree = Ext.tree;        
    var tree = new Tree.TreePanel({        
        el:'tree-div',        
        useArrows:true,        
        autoScroll:true,        
        animate:true,        
        enableDD:true,        
        containerScroll: true,         
        loader: new Tree.TreeLoader({        
        dataUrl:'treecheckjson.jsp'       
        })        
    });        
   
     tree.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);           
        });           
    }, tree);        
        
    var root = new Tree.AsyncTreeNode({        
        text: 'Ext JS',        
        draggable:false,     
        checked:false,    
        id:'0'       
    });        
    tree.setRootNode(root);       
        
    tree.render();        
    root.expand();      
 // (checkbox)        
// ExtJs  tree , , 。    
// , !   
var checkedNodes = tree.getChecked();//tree .    
var s = [];    
for(var i=0;i<checkedNodes.length;i++){    
s.push(checkedNodes[i].id)    
}   // node id  

좋은 웹페이지 즐겨찾기