Upgrade to ExtJS 3.1.1 - Released 02/08/2010
[extjs.git] / src / data / Tree.js
index 601437f..f0c5479 100644 (file)
@@ -1,6 +1,6 @@
 /*!
- * Ext JS Library 3.1.0
- * Copyright(c) 2006-2009 Ext JS, LLC
+ * Ext JS Library 3.1.1
+ * Copyright(c) 2006-2010 Ext JS, LLC
  * licensing@extjs.com
  * http://www.extjs.com/license
  */
@@ -543,6 +543,20 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, {
         this.parentNode.removeChild(this, destroy);\r
         return this;\r
     },\r
+    \r
+    /**\r
+     * Removes all child nodes from this node.\r
+     * @param {Boolean} destroy <tt>true</tt> to destroy the node upon removal. Defaults to <tt>false</tt>.\r
+     * @return {Node} this\r
+     */\r
+    removeAll : function(destroy){\r
+        var cn = this.childNodes,\r
+            n;\r
+        while((n = cn[0])){\r
+            this.removeChild(n, destroy);\r
+        }\r
+        return this;\r
+    },\r
 \r
     /**\r
      * Returns the child node at the specified index.\r