From: Alan Knowles Date: Thu, 12 Mar 2020 07:58:54 +0000 (+0800) Subject: compled version of remove length from mixced collection X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=aed997d7111c547c2693aeaefde2f32d7a267bbd compled version of remove length from mixced collection --- diff --git a/docs/src/Roo_util_MixedCollection.js.html b/docs/src/Roo_util_MixedCollection.js.html index 49ef892ac6..c6fe719d68 100644 --- a/docs/src/Roo_util_MixedCollection.js.html +++ b/docs/src/Roo_util_MixedCollection.js.html @@ -323,6 +323,9 @@ mc.add(otherEl); * @return {Object} The item associated with the passed key. */ item : function(key){ + if (key === 'length') { + return null; + } var item = typeof this.map[key] != "undefined" ? this.map[key] : this.items[key]; return typeof item != 'function' || this.allowFunctions ? item : null; // for prototype! }, diff --git a/roojs-all.js b/roojs-all.js index 7390bb00c1..118a5ebfb6 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -546,14 +546,14 @@ for(var i=0,C=B.length;i=this.length){return this.add(B,o);}this.length++;this.items.splice(A,0,o);if(typeof B!="undefined"&&B!=null){this.map[B]=o;}this.keys.splice(A,0,B);this.fireEvent("add",A,o,B); return o;},remove:function(o){return this.removeAt(this.indexOf(o));},removeAt:function(A){if(A=0){this.length--;var o=this.items[A];this.items.splice(A,1);var B=this.keys[A];if(typeof B!="undefined"){delete this.map[B];}this.keys.splice(A,1); this.fireEvent("remove",o,B);}},removeKey:function(A){return this.removeAt(this.indexOfKey(A));},getCount:function(){return this.length;},indexOf:function(o){if(!this.items.indexOf){for(var i=0,A=this.items.length;i=B;i--){r[r.length]=C[i];}}return r;},filter:function(A,B){if(!B.exec){B=String(B);if(B.length==0){return this.clone(); -}B=new RegExp("^"+Roo.escapeRe(B),"i");}return this.filterBy(function(o){return o&&B.test(o[A]);});},filterBy:function(fn,A){var r=new Roo.util.MixedCollection();r.getKey=this.getKey;var k=this.keys,it=this.items;for(var i=0,B=it.length;i=B;i--){r[r.length]=C[i];}}return r;},filter:function(A,B){if(!B.exec){B=String(B); +if(B.length==0){return this.clone();}B=new RegExp("^"+Roo.escapeRe(B),"i");}return this.filterBy(function(o){return o&&B.test(o[A]);});},filterBy:function(fn,A){var r=new Roo.util.MixedCollection();r.getKey=this.getKey;var k=this.keys,it=this.items;for(var i=0,B=it.length; +i=this.length){return this.add(B,o);}this.length++;this.items.splice(A,0,o);if(typeof B!="undefined"&&B!=null){this.map[B]=o;}this.keys.splice(A,0,B);this.fireEvent("add",A,o,B); return o;},remove:function(o){return this.removeAt(this.indexOf(o));},removeAt:function(A){if(A=0){this.length--;var o=this.items[A];this.items.splice(A,1);var B=this.keys[A];if(typeof B!="undefined"){delete this.map[B];}this.keys.splice(A,1); this.fireEvent("remove",o,B);}},removeKey:function(A){return this.removeAt(this.indexOfKey(A));},getCount:function(){return this.length;},indexOf:function(o){if(!this.items.indexOf){for(var i=0,A=this.items.length;i=B;i--){r[r.length]=C[i];}}return r;},filter:function(A,B){if(!B.exec){B=String(B);if(B.length==0){return this.clone(); -}B=new RegExp("^"+Roo.escapeRe(B),"i");}return this.filterBy(function(o){return o&&B.test(o[A]);});},filterBy:function(fn,A){var r=new Roo.util.MixedCollection();r.getKey=this.getKey;var k=this.keys,it=this.items;for(var i=0,B=it.length;i=B;i--){r[r.length]=C[i];}}return r;},filter:function(A,B){if(!B.exec){B=String(B); +if(B.length==0){return this.clone();}B=new RegExp("^"+Roo.escapeRe(B),"i");}return this.filterBy(function(o){return o&&B.test(o[A]);});},filterBy:function(fn,A){var r=new Roo.util.MixedCollection();r.getKey=this.getKey;var k=this.keys,it=this.items;for(var i=0,B=it.length; +i