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

4 posts, 0 answers
  1. Shane
    Shane avatar
    12 posts
    Member since:
    Dec 2017

    Posted 11 Jan Link to this post

    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

  2. Tyler
    Tyler avatar
    68 posts
    Member since:
    Feb 2017

    Posted 12 Jan in reply to Shane Link to this post

    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.

  3. Shane
    Shane avatar
    12 posts
    Member since:
    Dec 2017

    Posted 12 Jan in reply to Tyler Link to this post

    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

     


  4. Tyler
    Tyler avatar
    68 posts
    Member since:
    Feb 2017

    Posted 12 Jan in reply to Shane Link to this post

    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.

Back to Top