PDA

View Full Version : [OPEN-1332] Bug in Ext.data.Store: find method



TheNephalim
14 Oct 2010, 1:23 PM
In the Ext.data.Store of ExtJs 3.x.x, the find method has the following code:



find : function(property, value, start, anyMatch, caseSensitive){
var fn = this.createFilterFn(property, value, anyMatch, caseSensitive);
return fn ? this.data.findIndexBy(fn, null, start) : -1;
},
The createFilterFn method has a signature of :



createFilterFn : function(property, value, anyMatch, caseSensitive, exactMatch){
If you call the find method without the exact match parameter passed, it defaults to finding any match, which can be problematic if you are looking for a specific record and not just any record(s). By adding the exactMatch parameter to the signature of the find method and the call to createFilterFn, this problem is resolved.