Вопрос

we have been trying to get the kendo scheduler working with signalr to create a realtime scheduler, are are able to successfully update the kendo console which now works for all clients connected to the scheduler. our trouble now is adding the event manually with javascript. here is our example:

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);
};
Это было полезно?

Решение

From the code snippet, I can't tell what you expect the e variable to be. It looks like you may be confusing the technical events of the widget with the conceptual event data which is displayed with the scheduler widget.

Here's one way to add an event to an existing scheduler widget (using the DataSource.add method):

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"
});

You would only use the ObservableObject.set method on existing models.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top