Roo/form/ComboBoxArray.js
[roojs1] / roojs-core-debug.js
index dea9301..62a8e9b 100644 (file)
@@ -10946,12 +10946,15 @@ Roo.CompositeElement.prototype = {
     /**
     * Filters this composite to only elements that match the passed selector.
     * @param {String} selector A string CSS selector
+    * @param {Boolean} inverse return inverse filter (not matches)
     * @return {CompositeElement} this
     */
-    filter : function(selector){
+    filter : function(selector, inverse){
         var els = [];
+        inverse = inverse || false;
         this.each(function(el){
-            if(el.is(selector)){
+            var match = inverse ? !el.is(selector) : el.is(selector);
+            if(match){
                 els[els.length] = el.dom;
             }
         });
@@ -15853,8 +15856,7 @@ Roo.extend(Roo.XComponent, Roo.util.Observable, {
         
         el = el || false;
         var hp = this.parent ? 1 : 0;
-        Roo.log('hp')
-        Roo.log(this.parent);
+        
         if (!el && typeof(this.parent) == 'string' && this.parent.substring(0,1) == '#') {
             // if parent is a '#.....' string, then let's use that..
             var ename = this.parent.substr(1)
@@ -15865,10 +15867,20 @@ Roo.extend(Roo.XComponent, Roo.util.Observable, {
                 return;
             }
         }
+        var tree = this._tree ? this._tree() : this.tree();
+
         
+        if (!this.parent && typeof(Roo.bootstrap) != 'undefined' && tree.xns == Roo.bootstrap) {
+            //el = Roo.get(document.body);
+            this.parent = { el : true };
+        }
+            
+            
         
         if (!this.parent) {
             
+            Roo.log("no parent - creating one");
+            
             el = el ? Roo.get(el) : false;     
             
             // it's a top level one..
@@ -15896,12 +15908,13 @@ Roo.extend(Roo.XComponent, Roo.util.Observable, {
                }
                // The 'tree' method is  '_tree now' 
             
-        var tree = this._tree ? this._tree() : this.tree();
         tree.region = tree.region || this.region;
+        
         if (this.parent.el === true) {
             // bootstrap... - body..
             this.parent.el = Roo.factory(tree);
         }
+        
         this.el = this.parent.el.addxtype(tree);
         this.fireEvent('built', this);
         
@@ -15950,7 +15963,15 @@ Roo.apply(Roo.XComponent, {
      
     elmodules : [],
 
-    
+     /**
+     * @property  build_from_html
+     * Build elements from html - used by bootstrap HTML stuff 
+     *    - this is cleared after build is completed
+     * @type {boolean} true  (default false)
+     */
+     
+    build_from_html : false,
+
     /**
      * Register components to be built later.
      *
@@ -16153,9 +16174,13 @@ Roo.apply(Roo.XComponent, {
      * 
      */ 
    
-    build : function() 
+    build : function(opts
     {
         
+        if (typeof(opts) != 'undefined') {
+            Roo.apply(this,opts);
+        }
+        
         this.preBuild();
         var mods = this.buildOrder();
       
@@ -16190,6 +16215,8 @@ Roo.apply(Roo.XComponent, {
                 if (!this.hideProgress && Roo.MessageBox) {
                     Roo.MessageBox.hide();
                 }
+                Roo.XComponent.build_from_html = false; // reset, so dialogs will be build from javascript
+                
                 Roo.XComponent.event.fireEvent('buildcomplete', _this.topModule);
                 
                 // THE END...
@@ -16198,8 +16225,7 @@ Roo.apply(Roo.XComponent, {
             
             var m = mods.shift();
             
-            Roo.log('m');
-            Roo.log(m);
+            
             Roo.debug && Roo.log(m);
             // not sure if this is supported any more.. - modules that are are just function
             if (typeof(m) == 'function') { 
@@ -16216,15 +16242,12 @@ Roo.apply(Roo.XComponent, {
                 Roo.MessageBox.updateProgress(  (total  - mods.length)/total, msg  );
             }
             
-            Roo.log('msg');
-            Roo.log(msg);
          
             // is the module disabled?
             var disabled = (typeof(m.disabled) == 'function') ?
                 m.disabled.call(m.module.disabled) : m.disabled;    
             
-            Roo.log('disabled');
-            Roo.log(disabled);
+            
             if (disabled) {
                 return progressRun(); // we do not update the display!
             }
@@ -16232,6 +16255,7 @@ Roo.apply(Roo.XComponent, {
             // now build 
             
                        
+                       
             m.render();
             // it's 10 on top level, and 1 on others??? why...
             return progressRun.defer(10, _this);