Ext.data.Store.find的匹配模式,
也就是说,store.find(‘find’, ‘a’);
如果store里面有两行record,
一行的find列是’ab’,
一行的find列是’a',
那么会返回先匹配到的那一行,而不是你想要的’a',
如果你想用find方法获得你给定的值相等的行,如果要用精确匹配,使用Ext.data.Store.findExact()方法
这个方法是这样实现的
findExact: function(property, value, start){
return this.data.findIndexBy(function(rec){
return rec.get(property)
}, this, start);
},
注意这里面的匹配使用的是恒等===,
在Ext官网的手册里面,上面提到的两个函数的说明,都是下面这句,
Finds the index of the first matching Record in this store by a specific field value.
Finds the index of the first matching Record in this store by a specific field value.
这里Ext可能疏忽了
本文摘自:http://blog.sina.com.cn/s/blog_454fbf740100vi1l.html ;在此表示感谢,的确解决了项目中隐藏的bug!