任何人都可以通过javascript按钮帮助我进行PUT操作。
action : function() {
var selectedRecords = this.view.viewGrid.getSelectedRecords();
var lengthAr = selectedRecords.length;
for (var i=0; i < lengthAr ; i++){
alert(selectedRecords[i].id);
}
},
我想更新所有selectedRecords [all]的一列。为此,我必须像这样进行PUT查询: http://wiki.openbravo.com/wiki/JSON_REST_Web_Services:
{data: {"_identifier":"United States","_entityName":"Country","$ref":"Country\/100","id":"100","client":
{"_identifier":"System","_entityName":"ADClient","$ref":"ADClient\/0","id":"0","active":true},"organization":
{"_identifier":"*","_entityName":"Organization","$ref":"Organization
... truncated for clarity ...
(USA)","_entityName":"ADLanguage","$ref":"ADLanguage\/192","id":"192","active":true},"currency":{"_identifier":
"USD","_entityName":"Currency","$ref":"Currency\/100","id":"100","active":true},"iBANLength":null,"iBANCode":null}}
但我是javascript的新手,我不知道如何做到这一点。我无法解除此代码: 什么是_identifier?不应该是来自selectedRecords [i] .id的ID吗? 我如何用javascript编写查询?