Upgrade to ExtJS 3.1.0 - Released 12/16/2009
[extjs.git] / docs / source / TreeLoader.html
index caff1cc..968d3d6 100644 (file)
@@ -1,17 +1,12 @@
-<html>
-<head>
-  <title>The source code</title>
-    <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
-    <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
-</head>
-<body  onload="prettyPrint();">
-    <pre class="prettyprint lang-js">/*!
- * Ext JS Library 3.0.3
- * Copyright(c) 2006-2009 Ext JS, LLC
- * licensing@extjs.com
- * http://www.extjs.com/license
- */
-<div id="cls-Ext.tree.TreeLoader"></div>/**\r
+<html>\r
+<head>\r
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />    \r
+  <title>The source code</title>\r
+    <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
+    <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
+</head>\r
+<body  onload="prettyPrint();">\r
+    <pre class="prettyprint lang-js"><div id="cls-Ext.tree.TreeLoader"></div>/**\r
  * @class Ext.tree.TreeLoader\r
  * @extends Ext.util.Observable\r
  * A TreeLoader provides for lazy loading of an {@link Ext.tree.TreeNode}'s child\r
@@ -81,7 +76,7 @@ Ext.tree.TreeLoader = function(config){
         "loadexception"\r
     );\r
     Ext.tree.TreeLoader.superclass.constructor.call(this);\r
-    if(typeof this.paramOrder == 'string'){\r
+    if(Ext.isString(this.paramOrder)){\r
         this.paramOrder = this.paramOrder.split(/[\s,|]/);\r
     }\r
 };\r
@@ -146,6 +141,12 @@ paramOrder: 'param1|param2|param'
      * <tt>{@link #paramOrder}</tt> nullifies this configuration.\r
      */\r
     paramsAsHash: false,\r
+    \r
+    <div id="cfg-Ext.tree.TreeLoader-nodeParameter"></div>/**\r
+     * @cfg {String} nodeParameter The name of the parameter sent to the server which contains\r
+     * the identifier of the node. Defaults to <tt>'node'</tt>.\r
+     */\r
+    nodeParameter: 'node',\r
 \r
     <div id="cfg-Ext.tree.TreeLoader-directFn"></div>/**\r
      * @cfg {Function} directFn\r
@@ -158,8 +159,10 @@ paramOrder: 'param1|param2|param'
      * This is called automatically when a node is expanded, but may be used to reload\r
      * a node (or append new children if the {@link #clearOnLoad} option is false.)\r
      * @param {Ext.tree.TreeNode} node\r
-     * @param {Function} callback\r
-     * @param (Object) scope\r
+     * @param {Function} callback Function to call after the node has been loaded. The \r
+     * function is passed the TreeNode which was requested to be loaded.\r
+     * @param (Object) scope The cope (<code>this</code> reference) in which the callback is executed.\r
+     * defaults to the loaded TreeNode.\r
      */\r
     load : function(node, callback, scope){\r
         if(this.clearOnLoad){\r
@@ -207,13 +210,9 @@ paramOrder: 'param1|param2|param'
             }\r
             return buf;\r
         }else{\r
-            for(var key in bp){\r
-                if(!Ext.isFunction(bp[key])){\r
-                    buf.push(encodeURIComponent(key), "=", encodeURIComponent(bp[key]), "&");\r
-                }\r
-            }\r
-            buf.push("node=", encodeURIComponent(node.id));\r
-            return buf.join("");\r
+            var o = Ext.apply({}, bp);\r
+            o[this.nodeParameter] = node.id;\r
+            return o;\r
         }\r
     },\r
 \r
@@ -303,7 +302,7 @@ new Ext.tree.TreePanel({
         if(this.applyLoader !== false && !attr.loader){\r
             attr.loader = this;\r
         }\r
-        if(typeof attr.uiProvider == 'string'){\r
+        if(Ext.isString(attr.uiProvider)){\r
            attr.uiProvider = this.uiProviders[attr.uiProvider] || eval(attr.uiProvider);\r
         }\r
         if(attr.nodeType){\r
@@ -345,7 +344,11 @@ new Ext.tree.TreePanel({
         var a = response.argument;\r
         this.fireEvent("loadexception", this, a.node, response);\r
         this.runCallback(a.callback, a.scope || a.node, [a.node]);\r
+    },\r
+    \r
+    destroy : function(){\r
+        this.purgeListeners();\r
     }\r
-});</pre>
-</body>
+});</pre>    \r
+</body>\r
 </html>
\ No newline at end of file