這是調度程序的故障排除幫助文章中(原因是該服務未返回創建的記錄)中列出的調度
var schedSource = new kendo.data.SchedulerDataSource({
schema: {
model: {
id:"taskId",
fields: {
taskId: {
from: "id",
type: "number"
},
start: { type: "date", from: "start" },
end: { type: "date", from: "end" },
title: { from: "title", defaultValue: "No title", validation: { required: true } },
}
}
},
transport: {
read: {
url: '/sched',
dataType: 'json',
cache: false
},
update : {
url: '/sched/update',
dataType: 'json'
},
create: {
url: '/schedCreate',
dataType: "json"
},
destroy: {
url: '/schedDelete',
dataType: "json"
},
parameterMap: function (options, operation) {
if (operation != "read") {
var d = new Date(options.start);
options.start = kendo.toString(new Date(d), "yyyy-MM-ddTHH:mm:ss");
console.log(options.start);
var d = new Date(options.end);
options.end = kendo.toString(new Date(d), "yyyy-MM-ddTHH:mm:ss");
}
},
},
});
$scope.schOptions.dataSource = schedSource;
:
是您在服務器上創建處理程序的返回值e創建模型? –
嗨拉爾斯,謝謝你的迴應。是啊,就是。我現在通過捕獲保存事件,然後在Sync中使用它來執行datasource.read來解決它。不知道這是做到這一點的最佳方式,但似乎可以正常工作 – user3181505
嗨,我的回答是否幫助您解決問題?如果是的話,你能否將我的答覆標記爲答案?這樣,使用Google發現問題的人可以更好地保證答案是正確的。 在此先感謝。 –