This is a migrated thread and some comments may be shown as answers.
Windows closing on SchedulerDataSource Add
1 Answer 17 Views
This is a migrated thread and some comments may be shown as answers.
Luciano Kaesemodel
Top achievements
Rank 1
Luciano Kaesemodel asked on 06 Jun 2014, 04:44 PM
Hello there.

I'm working in an implementation using SignalR and the Kendo Scheduler. When a new task is created (for exemple), the SchedulerDataSource transport send the connection hub id to the server as an additional parameter:

parameterMap: function (options, operation) {
   if (operation == "destroy" && options.models) {
      return JSON.stringify({ taskId: options.models[0].Id, callerId: $.connection.hub.id });
   }
   if (operation !== "read" && options.models) {
      return JSON.stringify({ tasks: options.models, callerId: $.connection.hub.id });
   }
}

The server do whatever it has to do, and send a notification to every other user, except de caller:

[HttpPost]
public JsonResult CreateTask(List<ScheduledEvent> tasks, string callerId)
{
   ...create task and other stuff

   //broadcast the newly created object to everyone except caller
   var hubContext = GlobalHost.ConnectionManager.GetHubContext<Notebooks.Hubs.SchedulerHub>();
   hubContext.Clients.AllExcept(callerId).UpdateSchedule(task);

   //return the object to caller
   return Json(task);
}

Once the other clients receive a new task from the hub, it is added to the SchedulerDataSource:

hub.client.updateSchedule = function (scheduledEvent) {
   schedulerDataSource.add(scheduledEvent);
}

Everything seems to work fine, and it really took me some time to realize this behavior: if a client have the scheduler window open, this window is closed once the schedulerDataSource is updated. This is expected or am I doing something wrong?

1 Answer, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 10 Jun 2014, 11:54 AM
Hi Luciano,

Current behavior is expected with the current logic - when you add new event through the dataSource, the scheduler is rebinding in order to render the added event which closes the edit window.  As from the provided information is not clear for us what is the exact scenario that you have - could you please provide the full scheduler code? This would help us advice you better how to proceed.

Kind Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Asked by
Luciano Kaesemodel
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Share this question
or