remove : function(record){
var index = this.data.indexOf(record);
this.data.removeAt(index);
+
if(this.pruneModifiedRecords){
this.modified.remove(record);
}
this.totalLength = Math.max(t, this.data.length+r.length);
this.add(r);
}
+
+ if(this.parent && !Roo.isIOS && !this.useNativeIOS && this.parent.emptyTitle.length) {
+
+ var e = new Roo.data.Record({});
+
+ e.set(this.parent.displayField, this.parent.emptyTitle);
+ e.set(this.parent.valueField, '');
+
+ this.insert(0, e);
+ }
+
this.fireEvent("load", this, r, options, o);
if(options.callback){
options.callback.call(options.scope || this, r, options, true);
var r = this.reader.readRecords(o);
this.loadRecords(r, {add: append}, true);
},
+
+ /**
+ * using 'cn' the nested child reader read the child array into it's child stores.
+ * @param {Object} rec The record with a 'children array
+ */
+ loadDataFromChildren : function(rec)
+ {
+ this.loadData(this.reader.toLoadData(rec));
+ },
+
/**
* Gets the number of cached records.
}
value = new RegExp((anyMatch === true ? '' : '^') + Roo.escapeRe(value), "i");
}
-
return function(r){
return value.test(r.data[property]);
};
* @param {Boolean} anyMatch True to match any part not just the beginning
*/
filter : function(property, value, anyMatch){
-
- 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]);
- }
- }
- });
-
- r._sort(property[0], 'ASC');
-
- this.data = r;
- this.fireEvent("datachanged", this);
+ var fn = this.createFilterFn(property, value, anyMatch);
+ return fn ? this.filterBy(fn) : this.clearFilter();
},
/**