我有一个甘特图,当我移动或更改开始/结束日期时,会更新数据库,但不会保留在甘特图上。我必须重新加载甘特图才能看到变化。有没有办法扩展更新事件以在更新后刷新?
$("#gantt_here").kendoGantt({
dataSource: {
batch: true,
transport: {
read: {
url: "http://URL/gantt/<?= $client ?>/<?= $project ?>",
dataType: "json"
},
update: {
url: "http://URL/ganttUpdate/<?= $client ?>/<?= $project ?>",
dataType: "json",
method: "post"
},
create: {
url: "http://URL/<?= $client ?>/<?= $project ?>",
dataType: "json"
},
destroy: {
url: "http://URL/ganttDestroy/<?= $client ?>/<?= $project ?>",
dataType: "json"
},
parameterMap: function (options, operation) {
if (operation !== "read") {
return {models: kendo.stringify(options.models || [options])};
}
}
},
schema: {
model: {
id: "id",
fields: {
id: {from: "id", type: "number"}, //
orderId: {from: "orderId", type: "number", validation: {required: true}}, //
parentId: {from: "parent", type: "number", validation: {required: true}}, //
start: {from: "start", type: "date"}, //
end: {from: "end", type: "date"}, //
title: {from: "title", defaultValue: "", type: "string"}, //
percentComplete: {from: "percentComplete", type: "number"}, //
client: {from: "client", type: "number", validation: {required: true}}, //
project: {from: "project", type: "string", validation: {required: true}}, //
summary: true,
expanded: true
}
}
}
}