roojs-core.js
[roojs1] / roojs-ui-debug.js
index 55946f0..7e2b7e2 100644 (file)
@@ -5259,6 +5259,7 @@ Roo.extend(Roo.data.Store, Roo.util.Observable, {
             }
             value = new RegExp((anyMatch === true ? '' : '^') + Roo.escapeRe(value), "i");
         }
+        
         return function(r){
             return value.test(r.data[property]);
         };
@@ -5290,8 +5291,59 @@ Roo.extend(Roo.data.Store, Roo.util.Observable, {
      * @param {Boolean} anyMatch True to match any part not just the beginning
      */
     filter : function(property, value, anyMatch){
-        var fn = this.createFilterFn(property, value, anyMatch);
-        return fn ? this.filterBy(fn) : this.clearFilter();
+        
+        if(typeof(property) == 'string'){
+            var fn = this.createFilterFn(property, value, anyMatch);
+            return fn ? this.filterBy(fn) : this.clearFilter();
+        }
+        
+        var fn = [];
+        var afn = [];
+        
+        var _this = this;
+        
+        Roo.each(property, function(p){
+            if(anyMatch == true){
+                afn.push(_this.createFilterFn(p, value, true));
+            }
+            
+            fn.push(_this.createFilterFn(p, value, false));
+        });
+        
+        if(!fn.length && !afn.length){
+            return this.clearFilter();
+        }
+        
+        this.snapshot = this.snapshot || this.data;
+        
+        var filterData = [];
+        
+        Roo.each(fn, function(f){
+            filterData.push(_this.queryBy(f, _this));
+        });
+        
+        Roo.each(afn, function(f){
+            filterData.push(_this.queryBy(f, _this));
+        });
+        
+        var data = this.snapshot || this.data;
+        
+        var r = new Roo.util.MixedCollection();
+        r.getKey = data.getKey;
+        
+        var keys =[];
+        
+        Roo.each(filterData, function(d){
+            var k = d.keys, it = d.items;
+            for(var i = 0, len = it.length; i < len; i++){
+                if(keys.indexOf(k[i]) == -1){
+                    r.add(k[i], it[i]);
+                }
+            }
+        });
+        
+        this.data = r;
+        this.fireEvent("datachanged", this);
     },
 
     /**
@@ -21549,7 +21601,7 @@ Roo.extend(Roo.form.TriggerField, Roo.form.TextField,  {
      * @cfg {String/Object} autoCreate A DomHelper element spec, or true for a default element spec (defaults to
      * {tag: "input", type: "text", size: "16", autocomplete: "off"})
      */
-    defaultAutoCreate : {tag: "input", type: "text", size: "16", autocomplete: "off"},
+    defaultAutoCreate : {tag: "input", type: "text", size: "16", autocomplete: "new-password"},
     /**
      * @cfg {Boolean} hideTrigger True to hide the trigger element and display only the base text field (defaults to false)
      */
@@ -21829,7 +21881,7 @@ Roo.extend(Roo.form.TextArea, Roo.form.TextField,  {
             this.defaultAutoCreate = {
                 tag: "textarea",
                 style:"width:300px;height:60px;",
-                autocomplete: "off"
+                autocomplete: "new-password"
             };
         }
         Roo.form.TextArea.superclass.onRender.call(this, ct, position);
@@ -22547,7 +22599,7 @@ Roo.extend(Roo.form.MonthField, Roo.form.TriggerField,  {
      * {tag: "input", type: "text", size: "10", autocomplete: "off"})
      */ 
     // private
-    defaultAutoCreate : {tag: "input", type: "text", size: "10", autocomplete: "off"},
+    defaultAutoCreate : {tag: "input", type: "text", size: "10", autocomplete: "new-password"},
     
     // private
     hiddenField: false,
@@ -26354,7 +26406,7 @@ Roo.extend(Roo.form.HtmlEditor, Roo.form.Field, {
     defaultAutoCreate : { // modified by initCompnoent..
         tag: "textarea",
         style:"width:500px;height:300px;",
-        autocomplete: "off"
+        autocomplete: "new-password"
     },
 
     // private
@@ -26445,7 +26497,7 @@ Roo.extend(Roo.form.HtmlEditor, Roo.form.Field, {
         this.defaultAutoCreate =  {
             tag: "textarea",
             style:'width: ' + this.width + 'px;height: ' + this.height + 'px;',
-            autocomplete: "off"
+            autocomplete: "new-password"
         };
     },
 
@@ -30273,7 +30325,7 @@ Roo.extend(Roo.form.FCKeditor, Roo.form.TextArea,
             this.defaultAutoCreate = {
                 tag: "textarea",
                 style:"width:300px;height:60px;",
-                autocomplete: "off"
+                autocomplete: "new-password"
             };
         }
         Roo.form.FCKeditor.superclass.onRender.call(this, ct, position);
@@ -30596,7 +30648,7 @@ Roo.extend(Roo.form.GridField, Roo.form.Field,  {
      * {tag: "input", type: "checkbox", autocomplete: "off"})
      */
    // defaultAutoCreate : { tag: 'div' },
-    defaultAutoCreate : { tag: 'input', type: 'hidden', autocomplete: 'off'},
+    defaultAutoCreate : { tag: 'input', type: 'hidden', autocomplete: 'new-password'},
     /**
      * @cfg {String} addTitle Text to include for adding a title.
      */
@@ -30839,7 +30891,7 @@ Roo.extend(Roo.form.DayPicker, Roo.form.Field,  {
      * @cfg {String/Object} autoCreate A DomHelper element spec, or true for a default element spec (defaults to
      * {tag: "input", type: "checkbox", autocomplete: "off"})
      */
-    defaultAutoCreate : { tag: "input", type: 'hidden', autocomplete: "off"},
+    defaultAutoCreate : { tag: "input", type: 'hidden', autocomplete: "new-password"},
     
    
     actionMode : 'viewEl',