我们一直在尝试使kendo调度程序与signalr一起创建实时调度程序,并且能够成功更新kendo控制台,该控制台现在可用于连接到该调度程序的所有客户端。我们现在的麻烦是使用javascript手动添加事件。这是我们的示例:
var notificationHub = $.connection.MyBookingHub;
notificationHub.client.Notify = function (MyStart, MyEnd, MyMessage) {
kendoConsole.log(kendo.toString(new Date(MyStart) + " " + new Date(MyEnd) + " " + MyMessage));
//this is where we are doing something wrong as we get an error regarding the "set" property
e.events.set("start", new Date(MyStart));
e.events.set("end", new Date(MyEnd));
e.events.set("title", MyMessage);
};
从代码片段中,我无法确定您期望e
变量是什么。看起来您可能会将窗口小部件的技术事件与与调度程序窗口小部件一起显示的概念性事件数据混淆了。
这里有一种方法将事件添加到现有的调度部件(使用DataSource.add方法):
var scheduler = $("#scheduler").data("kendoScheduler");
scheduler.dataSource.add( {
start: new Date("2013/6/6 08:00 AM"),
end: new Date("2013/6/6 09:00 AM"),
title: "Interview"
});
您只能在现有模型上使用ObservableObject.set方法。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句