Roo/bootstrap/Component.js
authorAlan Knowles <alan@roojs.com>
Thu, 21 Feb 2019 09:00:56 +0000 (17:00 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 21 Feb 2019 09:00:56 +0000 (17:00 +0800)
Roo/bootstrap/Component.js

index c14252d..8d07b86 100644 (file)
@@ -374,6 +374,30 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent,  {
     },
     
     
+    /**
+     * xAddChildren - the 'sub-compentized' version of the above idea..
+     */
+    xAddChildren: function(child_array, skip_children)
+    {
+       var nitems = [];
+       if (!child_array || !child_array.length ) {
+            this.items = nitems;
+            return;
+        }
+       
+       for(var i =0;i < child_array.length;i++) {
+           if (skip_children) {
+               break;
+           }
+           //  Roo.log(['add child', items[i]]);
+           nitems.push(this.xAdd(Roo.apply({}, child_array[i])));
+       }
+       this.items = nitems;
+        
+        this.fireEvent('childrenrendered', this);
+         
+    },
+    
     
     /**
      * Set the element that will be used to show or hide