在 kendo ui 小部件代码触发后,我没有看到用于添加回调的文档。我有以下剑道 ui 小部件声明。
$("#scheduler").kendoScheduler({
date: new Date("2013/6/13"), // Change this to current date with twig
startTime: new Date("2013/6/13 07:00 AM"), // Change this to 12:00 AM of current date
allDaySlot: false,
width:600,
height:500,
resize: function(e) {
if (careGiverIsOccupied(e.start, e.end, e.event, e.resources)) {
this.wrapper.find(".k-marquee-color").addClass("invalid-slot");
e.preventDefault();
}
},
resizeEnd: function(e) {
if (!checkAvailability(e.start, e.end, e.events)) {
e.preventDefault();
}
},
move: function(e) {
if (careGiverIsOccupied(e.start, e.end, e.event, e.resources)) {
this.wrapper.find(".k-event-drag-hint").addClass("invalid-slot");
}
},
moveEnd: function(e) {
if (!checkAvailability(e.start, e.end, e.event, e.resources)) {
e.preventDefault();
}
},
add: function(e) {
if (!checkAvailability(e.event.start, e.event.end, e.event)) {
e.preventDefault();
}
changeColors();
},
save: function(e) {
if (!checkAvailability(e.event.start, e.event.end, e.event)) {
e.preventDefault();
}
changeColors();
},
views: [
"week",
"month"
],
dataSource: {
data: [
{
eventID: 2,
title: "Hey man",
start: new Date("2013/6/13 12:00"),
end: new Date("2013/6/13 13:30"),
pending: true,
permissionToDelete: false,
careGiverId: 1
},
{
eventID: 1,
title: "Call Charlie about the project",
start: new Date("2013/6/13 10:30"),
end: new Date("2013/6/13 11:30"),
pending: false,
permissionToDelete: false,
careGiverId: 1
}
],
schema: {
model: {
id: "eventID",
fields: {
eventID: { type: "number" },
title: { defaultValue: "No title", validation: { required: true } },
start: { type: "date" },
end: { type: "date" },
careGiverId: { nullable: true },
pending: { type: "boolean", defaultValue:true },
permissionToDelete: { type: "boolean", defaultValue:true },
isAllDay: { type: "boolean" }
}
}
}
},
group: {
resources: [ "care" ]
},
resources: [
{
field: "careGiverId",
name: "care",
dataSource: [
{
// Change the text with care giver name, change value with care giver id
text: "Jeffery Dohmer (Care Giver 1)", value: 1, color: "#00FF00"
}
],
title: "Care"
}
]
});
问题是我的文档的 dom 结构在 resizeEnd、move、moveEnd、add 和 save 等事件处理程序被触发后被修改。我想做的是在 kendoScheduler 添加或节省时间之后更改特定元素的颜色。完成后是否有添加回调?