Javascript 剑道计划程序不显示数据
我可能只是遗漏了一些东西,但我正在尝试用提供的数据对象填充剑道调度程序。首先加载我的数据对象,然后加载并初始化剑道调度程序。请注意,除了加载初始数据集之外,其他一切都在调度程序上工作。以下是我的数据:Javascript 剑道计划程序不显示数据,javascript,jquery,kendo-ui,kendo-scheduler,Javascript,Jquery,Kendo Ui,Kendo Scheduler,我可能只是遗漏了一些东西,但我正在尝试用提供的数据对象填充剑道调度程序。首先加载我的数据对象,然后加载并初始化剑道调度程序。请注意,除了加载初始数据集之外,其他一切都在调度程序上工作。以下是我的数据: var _data = [{ eventID: 7, title: "Physical therapy.", start: new Date("2013/06/12 13:00"), end: new Date("2013/06/12 14:30"), pe
var _data = [{
eventID: 7,
title: "Physical therapy.",
start: new Date("2013/06/12 13:00"),
end: new Date("2013/06/12 14:30"),
pending:true,
recurrenceRule: "",
recurrenceException: "",
description: "Take my mom to her physical therapy.",
isAllDay:false,
ownTimeSlot:true,
careAssistantId: 5,
clientId: 6
},{
eventID: 8,
title: "Group meeting.",
start: new Date("2013/06/13 12:00"),
end: new Date("2013/06/13 13:30"),
pending:false,
recurrenceRule: "",
recurrenceException: "",
description: "Take my brother to his group meeting.",
isAllDay:false,
ownTimeSlot:true,
careAssistantId: 5,
clientId: 6
},{
eventID: 9,
title: "Make dinner.",
start: new Date("2013/06/13 18:00"),
end: new Date("2013/06/13 20:30"),
pending:true,
recurrenceRule: "FREQ=DAILY;INTERVAL=2;COUNT=8",
recurrenceException: "",
description: "Make dinner for my mom.",
isAllDay:false,
ownTimeSlot:true,
careAssistantId: 5,
clientId: 6
}, ];
_数据在我的脚本中是一个全局变量,所以我不确定这是否会给剑道带来麻烦。下一位代码加载在my_数据变量之后
$("#scheduler").kendoScheduler({
date: new Date(_startDate), // Change this to current date with twig
startTime: new Date(_startTime), // Change this to 12:00 AM of current date
allDaySlot: true,
edit: function(e) {
editScheduler(e);
},
moveStart: function(e) {
moveStartScheduler(e);
},
navigate: function(e) {
navigateScheduler(e);
},
remove: function(e) {
removeScheduler(e);
},
resize: function(e) {
resizeScheduler(e);
},
resizeEnd: function(e) {
resizeEndScheduler(e);
},
move: function(e) {
moveScheduler(e);
},
moveEnd: function(e) {
moveEndScheduler(e);
},
add: function(e) {
addScheduler(e);
},
dataBound: function(e) {
dataBoundScheduler(e);
},
save: function(e) {
saveScheduler(e);
},
views: [
"week",
"month"
],
dataSource: {
data: _data,
schema: {
model: {
id: "eventID",
fields: {
eventID: { type: "number" },
title: { defaultValue: "No title", validation: { required: true } },
start: { type: "date" },
end: { type: "date" },
pending: { type: "boolean", defaultValue:true },
recurrenceRule: { nullable: true },
recurrenceException: { nullable: true },
description: { nullable: true },
careAssistantId: { nullable: true },
clientId: { nullable:true },
ownTimeSlot: { type: "boolean", defaultValue:true },
isAllDay: { type: "boolean" }
}
}
}
},
group: {
resources: [ "care" ]
},
resources: [
{
field: "careAssistantId",
name: "care",
dataSource: [
{
// Change the text with care giver name, change value with care giver id
text: _schedulerName, value: _schedulerId, color: "#00FF00"
}
],
title: "Care"
}
]
});
我使用的所有变量都是定义的,所以我可能只是在某个地方有一个小的语法错误。奇怪的是,firefox firebug中没有生成任何错误。稍微修改一下的版本似乎可以正常工作: 以下是有效的代码:
var _data = [{
eventID: 7,
title: "Physical therapy.",
start: new Date("2013/06/12 13:00"),
end: new Date("2013/06/12 14:30"),
pending:true,
recurrenceRule: "",
recurrenceException: "",
description: "Take my mom to her physical therapy.",
isAllDay:false,
ownTimeSlot:true,
careAssistantId: 5,
clientId: 6
},{
eventID: 8,
title: "Group meeting.",
start: new Date("2013/06/13 12:00"),
end: new Date("2013/06/13 13:30"),
pending:false,
recurrenceRule: "",
recurrenceException: "",
description: "Take my brother to his group meeting.",
isAllDay:false,
ownTimeSlot:true,
careAssistantId: 5,
clientId: 6
},{
eventID: 9,
title: "Make dinner.",
start: new Date("2013/06/13 18:00"),
end: new Date("2013/06/13 20:30"),
pending:true,
recurrenceRule: "FREQ=DAILY;INTERVAL=2;COUNT=8",
recurrenceException: "",
description: "Make dinner for my mom.",
isAllDay:false,
ownTimeSlot:true,
careAssistantId: 5,
clientId: 6
} ];
$("#scheduler").kendoScheduler({
date: new Date("2013/06/13"), // Change this to current date with twig
startTime: new Date("2013/06/13 10:00"), // Change this to current date with twig
allDaySlot: true,
edit: function(e) {
editScheduler(e);
},
moveStart: function(e) {
moveStartScheduler(e);
},
navigate: function(e) {
navigateScheduler(e);
},
remove: function(e) {
removeScheduler(e);
},
resize: function(e) {
resizeScheduler(e);
},
resizeEnd: function(e) {
resizeEndScheduler(e);
},
move: function(e) {
moveScheduler(e);
},
moveEnd: function(e) {
moveEndScheduler(e);
},
add: function(e) {
addScheduler(e);
},
dataBound: function(e) {
dataBoundScheduler(e);
},
save: function(e) {
saveScheduler(e);
},
views: [
"week",
"month"
],
dataSource: {
data: _data,
schema: {
model: {
id: "eventID",
fields: {
eventID: { type: "number" },
title: { defaultValue: "No title", validation: { required: true } },
start: { type: "date" },
end: { type: "date" },
pending: { type: "boolean", defaultValue:true },
recurrenceRule: { nullable: true },
recurrenceException: { nullable: true },
description: { nullable: true },
careAssistantId: { nullable: true },
clientId: { nullable:true },
ownTimeSlot: { type: "boolean", defaultValue:true },
isAllDay: { type: "boolean" }
}
}
}
}
});
谢谢,不幸的是,我需要实现分组,因为我限制了一个组的可用时间段。但我想我看到了一个语法错误,你修复了这个错误,这会让我的东西正常工作。如果是那个语法错误造成的,我会接受你的回答。@AtanasKorchev我如何在剑道调度程序中定义15分钟间隔的时间间隔?像这样的1.15,1.30,1.45,2.00,2.15。。。。我试过每排几分钟,但不起作用。我找不到这方面的最新文档。请帮助…我有同样的问题,没有显示在调度数据。你曾经解决过这个问题吗?是的,我只是下载了他们在示例中使用的脚本,而不是官方发布的脚本。示例脚本是不同的,并且更为最新。