Ext version tested: Browser versions tested against: Description:

Here is a fiddle that demonstrates the problem:

http://ift.tt/1JcXCiD


1. Click "Edit"

2. Remove an order. Click "Remove"

3. Click "Save"

4. The application throws this error message:

Uncaught Error: Cannot drop, record does not exist: [object Object]@Order


This happens only when writeAllFields is set to true in the models.



Code:



writer : {
writeAllFields : true
}

The problem is in the function dropEntities of Ext.data.Session

The parameter ids contains an array of numbers (id) when writeAllFields is false.

But when it's true ids contains an array of model objects.

Code:



dropEntities: function(entityType, ids) {
var len = ids.length,
i, rec, id;


for (i = 0; i < len; ++i) {
id = ids[i];
rec = this.peekRecord(entityType, id);
if (rec) {
rec.drop();
} else {
this.onInvalidEntityDrop(entityType, id);
}
}
},

writeAllFields:true --> ids = [{date: ..., id: 7, shipped: ..., customerId: ...}]

writeAllFields:false --> ids = [7]

Ralph