X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..10a866c12701c0a0afd0ac85dcdcf32a421514ac:/docs/source/TreeLoader.html?ds=inline diff --git a/docs/source/TreeLoader.html b/docs/source/TreeLoader.html index 1b8d1561..968d3d67 100644 --- a/docs/source/TreeLoader.html +++ b/docs/source/TreeLoader.html @@ -1,5 +1,6 @@
+this
reference) in which the callback is executed.
+ * defaults to the loaded TreeNode.
*/
load : function(node, callback, scope){
if(this.clearOnLoad){
@@ -162,7 +171,7 @@ paramOrder: 'param1|param2|param'
}
}
if(this.doPreload(node)){ // preloaded json children
- this.runCallback(callback, scope || node, []);
+ this.runCallback(callback, scope || node, [node]);
}else if(this.directFn || this.dataUrl || this.url){
this.requestData(node, callback, scope || node);
}
@@ -201,13 +210,9 @@ paramOrder: 'param1|param2|param'
}
return buf;
}else{
- for(var key in bp){
- if(!Ext.isFunction(bp[key])){
- buf.push(encodeURIComponent(key), "=", encodeURIComponent(bp[key]), "&");
- }
- }
- buf.push("node=", encodeURIComponent(node.id));
- return buf.join("");
+ var o = Ext.apply({}, bp);
+ o[this.nodeParameter] = node.id;
+ return o;
}
},
@@ -272,7 +277,7 @@ paramOrder: 'param1|param2|param'
* Example:
new Ext.tree.TreePanel({
...
- new Ext.tree.TreeLoader({
+ loader: new Ext.tree.TreeLoader({
url: 'dataUrl',
createNode: function(attr) {
// Allow consolidation consignments to have
@@ -281,7 +286,7 @@ new Ext.tree.TreePanel({
attr.iconCls = 'x-consol',
attr.allowDrop = true;
}
- return Ext.tree.TreeLoader.prototype.call(this, attr);
+ return Ext.tree.TreeLoader.prototype.createNode.call(this, attr);
}
}),
...
@@ -294,10 +299,10 @@ new Ext.tree.TreePanel({
if(this.baseAttrs){
Ext.applyIf(attr, this.baseAttrs);
}
- if(this.applyLoader !== false){
+ if(this.applyLoader !== false && !attr.loader){
attr.loader = this;
}
- if(typeof attr.uiProvider == 'string'){
+ if(Ext.isString(attr.uiProvider)){
attr.uiProvider = this.uiProviders[attr.uiProvider] || eval(attr.uiProvider);
}
if(attr.nodeType){
@@ -339,6 +344,10 @@ new Ext.tree.TreePanel({
var a = response.argument;
this.fireEvent("loadexception", this, a.node, response);
this.runCallback(a.callback, a.scope || a.node, [a.node]);
+ },
+
+ destroy : function(){
+ this.purgeListeners();
}
});