Jun 05, 2012, 3:30 AM
[CLOSED] JavaScript error in rejectChanges() method in Ext.NET's Store override
I am getting a JavaScript error when calling a Store's rejectChanges() method, saying "me" is not defined.
This looks to be the relevant bit of code. I think "me = this" just needs to be added to the variable declarations, or maybe just use this?
This looks to be the relevant bit of code. I think "me = this" just needs to be added to the variable declarations, or maybe just use this?
rejectChanges : function (actions) {
var i,
len,
records,
record;
actions = Ext.apply({
create : true,
update : true,
destroy : true
}, actions || {});
if (actions.create) {
records = me.getNewRecords();
len = records.length;
if (len > 0) {
for (i = 0; i < len; i++) {
record = records[i];
this.remove(record, true);
}
}
}
if (actions.update) {
records = me.getUpdatedRecords();
len = records.length;
if (len > 0) {
for (i = 0; i < len; i++) {
record = records[i];
record.reject();
}
}
}
if (actions.destroy) {
records = me.getRemovedRecords();
len = records.length;
if (records.length > 0) {
var autoSync = this.autoSync;
this.autoSync = false;
this.add(records);
this.autoSync = autoSync;
this.removed = [];
}
}
},
Hope that helps.
Last edited by geoffrey.mcgill; Jun 06, 2012 at 8:54 PM.
Reason: [CLOSED]