如何定制 spread.dataManager 返回的响应结构?
后端返回JSON是 {"msg":"success","code":200,"total":146,"data":{ ...}}
官网例子是返回整个解析对象 {{},{},....}
应该如何设置?
var myTable = dataManager.addTable("myTable", {
remote: {
read: {
url: apiUrl
},
update: {
url: apiUrl,
method: 'PUT'
},
create: {
url: apiUrl
},
delete: {
url: apiUrl,
method: 'DELETE'
}
// batch: {
// url: batchApiUrl
// }
},
//batch: true,
autoSync: true, // enable the autoSync mode
onFailed: function(type, args) {
console.log("error", type, args);
}
});
|