extjs中TreeLoader加参数

	
/**
 * 重新加载数据
 * @param params
*/

[color=darkred]var treeLoad = new Ext.tree.TreeLoader({
	url : "createTree.do",
	requestMethod : 'POST',
	baseParams:{method:'CreateTree',id:node.id}
});[/color]

treeLoad .on('beforeload', function(treeLoader, node) {
	var id = node.attributes.id;
var para = {id:id};
	    	    
	   Ext.apply(treeLoader.baseParams , para);
	    	    if( treeLoader.baseParams == null ){
	    	    	treeLoader.baseParams = para;
	    	    }
	    	    
				treeLoader.url = node.attributes.url;
				
				return true;
		}, treeData);


//----------------------------------------------------
var treeLoad = treePanel.getLoader();
treeLoad.baseParams = params;
treeLoad.load(root, function(){});//重新加载数据
this.expandAll();
			},

你可能感兴趣的:(loader)