treecheck

1627 단어 UIjspext
 Ext.BLANK_IMAGE_URL = "ext/resources/images/default/s.gif";
   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                 

좋은 웹페이지 즐겨찾기