This is a migrated thread and some comments may be shown as answers.

How can I update a few scheduler events after I only update one?

3 Answers 363 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Shane
Top achievements
Rank 1
Shane asked on 12 Jan 2018, 12:46 AM

The way our setup works updating one event might cause other events to "shift" so the server sends back all  Scheduler Events that were modified. I tried just returning all of those as JSON but the scheduler doesn't seem to pick up on them.

Is there a way to sync whatever the server returned with the datasource for the scheduler? or do I just need to issue a read()

 

Looking at

_accept: function(result) inside kendo.data.js

I can see that it just uses the original batch of models and the index order to do updates so it can't really handle more items coming back then were sent

3 Answers, 1 is accepted

Sort by
0
Tyler
Top achievements
Rank 1
answered on 12 Jan 2018, 02:46 PM

So you have an array of local data as opposed to remote data? But yes, trigger a dataSource read.

I keep an array of local event data, so I get my event info from the server in the dataBinding event, I go through and create new kendo.SchedulerEvent for each one, put them into a global array that holds my kendo events, then call scheduler.dataSource.read() in my dataBinding event.

My read has e.success(eventArr), which is the array I just made, so it will refresh the scheduler view with the newly read in events.

I am not entirely familiar with using remote data, however. But it does sound like the scheduler is just not updating itself after you save an event, so you will want to call a read that takes your new events via remote data or local and the scheduler should refresh and update.

0
Shane
Top achievements
Rank 1
answered on 12 Jan 2018, 05:31 PM

Currently I'm all just straight using the transport remote data structures but I was debating doing it like you described so that I could just have more incremental control.

When a single event is updated the server might return 10 different events that update affects so I'd like to update all 10 of those on the calendar. The scheduler doesn't really handle this type of variation of output/input. It expects you to return an array in the same order and size as was pushed to the server

 

But you have a lot of good notes in there of things I can try with what I have to see if I can get it to work. Thank you

 


0
Tyler
Top achievements
Rank 1
answered on 12 Jan 2018, 10:18 PM

No problem. Yeah, with keeping local data, I completely refresh my scheduler after any changes are made to any event. It creates/updates, saves, all triggers and whatnot run on create/update of event, then I query all my events that are within the current view again and put them into my global event array, and refresh with everything updated. Such a way should provide you the results you need. 

I am not really sure of the workings of using remote data, though, as I have only been working with local data.

Tags
Scheduler
Asked by
Shane
Top achievements
Rank 1
Answers by
Tyler
Top achievements
Rank 1
Shane
Top achievements
Rank 1
Share this question
or