ExtJs 动态树

 

 

ExtJs 动态树_第1张图片

 

 

Ext.onReady(function() {
	Ext.BLANK_IMAGE_URL = "/RPM/RPSpages/js/extjs/resources/images/default/s.gif";
	var Tree = Ext.tree;
	var treenode;
	var codeTableName = document.getElementById("codeTableName").value;
	var codeValue = document.getElementById("codeValue").value;
	var codeDesc = document.getElementById("codeDesc").value;
	var ifTreeCodeTable = document.getElementById("ifTreeCodeTable").value;
	var treeTableParent = document.getElementById("treeTableParent").value;

	var treeloader = new Tree.TreeLoader({
				dataUrl : "treeParameter.action",
				baseParams : {
					codeTableName : codeTableName,
					codeValue : codeValue,
					codeDesc : codeDesc,
					ifTreeCodeTable : ifTreeCodeTable,
					treeTableParent : treeTableParent
				}
			});

	var rootnode = new Tree.AsyncTreeNode({
				id : '-1',
				text : '请选择节点'
			});
	var treepanel = new Tree.TreePanel({
				el : 'tree_div',
				rootVisible : false,
				border : false,
				height : 400,
				animate : true,
				autoScroll : true,
				enableDD : false,
				containerScroll : false,
				expanded : true,
				loader : treeloader
			});

	treepanel.setRootNode(rootnode);

	treepanel.on('click', function(node) {
				treenode = node.id;
				treename = node.text;
			});
	this.subtree = function list(node) {
		if (treenode == null) {
			alert('请选择节点');
		} else {
			var str;
			str = new Array(2);
			str[0] = treenode;
			str[1] = treename;
			window.returnValue = str;
			window.close();
		}

	}
	treepanel.on('beforeload', function(node) {
				treepanel.loader.dataUrl = 'treeParameter.action';
			});

	treepanel.render();
	rootnode.expand(false, false);
});


 

 

 

你可能感兴趣的:(list,function,image,tree,ExtJs,border)