【发布时间】:2015-10-09 05:43:05
【问题描述】:
我刚刚开始使用 Kendo UI,我正在尝试使用 Kendo 的 DataSource 来更新 Grid 值,但是检查设置为请求 url 的后端 PHP 脚本,似乎收到了请求,但没有POST参数
dataSource: {
transport: {
read: {
type: "POST",
url: "model/master_service2_data.php?sp_type=INQ",
dataType: "json"
},
update: {
url: "model/master_service2_data.php?sp_type=INS",
type: "post",
dataType: "json"
},
create: {
url: "model/master_service2_data.php?sp_type=INS",
type: "post",
dataType: "json"
},
parameterMap: function(options, operation) {
console.log(operation);
console.log(options);
if (operation !== "read" && options.models) {
return {models: kendo.stringify(options.models)};
}
}
},
schema: {
data: "data",
total: function (result) {
result = result.data || result;
return result.length;
},
model: {
id: "Paket_Detail_ID",
fields: {
Paket_ID: { type: "string" },
Paket_Detail_Desc: {type: "string"}
}
}
},
pageSize: 20
}
在 parameterMap 函数中查看 console.log 的输出显示 options.models 不可用,这有关系吗? console.log(options) 确实显示了正确的 POST 参数,但服务器脚本没有收到它们
【问题讨论】:
-
您好,我的回答对您的问题有帮助吗?如果是,您能否将我的回复标记为答案?这样,使用 Google 找到问题的人可以更加确信答案是正确的。提前致谢。
标签: php kendo-ui kendo-grid kendo-datasource