PDA

View Full Version : store.find()



heheahn
30 Mar 2011, 12:39 AM
store.find() function does not seem to work for combo... ( in ExtJS 4.0 PR5)

1. select listener fire this line.

ext-all-debug.js
line: 7062


findRecord: function(field, value) {
var ds = this.store, // ArrayStore!!!!
idx = ds.find(field, value); // index

for ( var i = 0, len = ds.getCount(); i < len; i++ ) {
var s = ds.getAt(i);
var val = s.get(field);
if ( val == value ) {
var test = i; // the test is different from index!!!!!!!!
break;
}
}

if (idx !== -1) {
return ds.getAt(idx);
} else {
return false;
}
},


2. select listener get fired twice.

Thanks.