PDA

View Full Version : [FIXED-130] Remove issue of Ext.data.Store



leeby
18 Jul 2010, 4:07 AM
Hi,

See below red code, the "this.snapshot" and "this.data" is actually the same object, so the remove function will delete 2 records at the same time. The right record and the next record.

It can be solved by simply adding a 'IF'.

=========================
remove: function(record) {
if (Ext.isArray(record)) {
for (var i = 0, length = record.length; i < length; i++) {
this.remove(record[i]);
}
return;
}

this.removed.push(record);

var index = this.data.indexOf(record);

if (this.snapshot) {
this.snapshot.remove(record);
}

if (index > -1) {
record.unjoin(this);
this.data.removeAt(index);

this.fireEvent('remove', this, record, index);
this.fireEvent('datachanged', this);
}
}

TommyMaintz
28 Jul 2010, 11:30 AM
This has been fixed and will be part of the next release (0.9.3) due beginning of next week.