Thank you for reporting this bug. We will make it our priority to review this report.
[5.1.1.264] Session management. Delete record with writeAllFields:true throws error
[5.1.1.264] Session management. Delete record with writeAllFields:true throws error
Ext version tested: Browser versions tested against: Description:
Here is a fiddle that demonstrates the problem:
http://ift.tt/1JcXCiD1. 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]@OrderThis 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
[5.1.1.264] Session management. Delete record with writeAllFields:true throws error
Aucun commentaire:
Enregistrer un commentaire