Hi
I have a JSON store class with the following method:
setupURL : function() {
this.setUrl(null);
if (this.__cmd == "SaveItem"){
var loReq = new dcbase.reqXhr({set: {url:
"SaveItem."+this.__scriptMap}});
loReq.setRequestData(this.__table+"~"+"ID~"+this.__changedItems.join(""));
loReq.setParser("json")
loReq.addListener("success", function (e) {
if (e.getTarget().getResponse().message != "Success"){
alert(e.getTarget().getResponse().message);
}
this.__changedItems = [];
},this);
loReq.send();
}
else if (this.__cmd == "NewItem"){}
else if (this.__cmd == "DuplicateItem"){}
else if (this.__cmd == "TransferItem"){}
else {
this.setUrl(this.__cmd+"."+this.__scriptMap+"?"+this.__table+"~"+this.__tag+"~"+this.getOrderBy()+"~"+this.__fldName+"~"+this.__fldVal+"~"+this.__filter+this.getFilterPID()+this.getFilterOther());
}
},
This function is responsible among other things for saving a changed
item to a table. The changed item is contained in the __changedItems
array. Once the request completes successfully I want the
__changedItems array to be empty. However this is not happening.
Instead the prototype still contains the __changedItems array and the
instance contains the empty array. What am I doing wrong or failing to
understand?
Secondly I would like to know why the __changedItems for one store are
the same items for a completely different and unrelated store? I would
have expected to see the __changedItems in the store where the changes
were made instead of being shared across all stores.
Thanks,
Simon
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel