The saving functions defined inside save() use this pointer. I think the pointer should be copied, as the functions do not clearly set the correct attributes in the ItemFileWriteStore?, and have to be set manually outside save(). An example in save():
var saveCompleteCallback = function(){
this._pending = {
_newItems:{},
_modifiedItems:{},
_deletedItems:{}
};
this._saveInProgress = false; // must come after this._pending is cleared, but before any callbacks
if(keywordArgs && keywordArgs.onComplete){
var scope = keywordArgs.scope || dojo.global;
keywordArgs.onComplete.call(scope);
}
};
Should perhaps be:
var _this = this;
var saveCompleteCallback = function(){
_this._pending = {
_newItems:{},
_modifiedItems:{},
_deletedItems:{}
};
_this._saveInProgress = false; // must come after this._pending is cleared, but before any callbacks
if(keywordArgs && keywordArgs.onComplete){
var scope = keywordArgs.scope || dojo.global;
keywordArgs.onComplete.call(scope);
}
};
Because this._pending and this._saveInProgress are not set correctly now.
(In [10483]) Minor fix to save. fixes #4394