-
14 Apr 2010 2:39 AM #1
find Exact in extjs 2.3
find Exact in extjs 2.3
How could we find exact match of value in store
i tried below but its not working properly
Code:store.find('name','demo')
-
14 Apr 2010 5:17 AM #2
Its solved now
Code:var val="^demo$"; var newval=new RegExp(val); store.find('name',newval);
-
18 May 2010 2:30 AM #3
Can't find the right if there exists special characters ( , ) , ?...
-
18 May 2010 3:18 AM #4
Solution :
Code:Ext.override(Ext.data.Store,{ /** * Finds the index of the first matching record in this store by a specific property/value. * @param {String} property A property on your objects * @param {String/RegExp} value The value to match against * @param {Number} startIndex (optional) The index to start searching at * @return {Number} The matched index or -1 */ findExact: function(property, value, start){ return this.data.findIndexBy(function(rec){ return rec.get(property) === value; }, this, start); } }); example: store.findExact("name","Finds the index (1)");Last edited by california; 18 May 2010 at 3:24 AM. Reason: edit


Reply With Quote