Ext3 동적 트리

1312 단어 ext

var tree = new Ext.tree.TreePanel({
	id: 'dirTree',
	title: ' ',
	width: 200,
        lines :false,
        rootVisible : false,
        loader: new Ext.tree.TreeLoader({
        	dataUrl: treeURL,
        	createNode : function(attr) {
			        if (this.applyLoader !== false) {
			            attr.loader = this;
			        }
			        var node = attr.defaulted ?
	                        new Ext.tree.TreeNode({text: attr.name, iconCls : attr.key, id: attr.id, allowDrop: !attr.defaulted}) :
		                        new Ext.tree.AsyncTreeNode({text: attr.name, iconCls : attr.key, id: attr.id, allowDrop: !attr.defaulted});
	                node.defaulted = attr.defaulted;
	                node.key = attr.key;
			        return node;
		    },
        	listeners :{
        		"beforeload": function(loader, node, callback) {
        			var parentId = node.id != "root" ? node.id : "";
        			loader.baseParams = {parentId: parentId, userId: userVO.id}
        		}
        	}
        }),
        root : new Ext.tree.AsyncTreeNode({text: ' ', id:'root'})
    });

좋은 웹페이지 즐겨찾기