Adding multiple events in one go

4 posts, 1 answers
  1. Paul
    Paul avatar
    24 posts
    Member since:
    Aug 2013

    Posted 29 Sep 2014 Link to this post

    I have a use case where I need to create multiple separate events when the user clicks 'save' to add a new event in the editor. My server-side is returning an array of events, but the scheduler only adds the first one. Is there a way I can get it to add all of them?

    My current work-around is to call dataSource.read() when I detect that multiple events have been returned, but there is a noticeable delay between the first event and the result of dataSource.read() being displayed in the scheduler.

    Cheers, Paul.
  2. Answer
    Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 01 Oct 2014 Link to this post

    Hi Paul,

    Basically current behavior is expected as the dataSource doesn't support out of the box to accept more records than the send with the "create" request. That why in current case I would suggest to continue reading the events after each create (or use "requestEnd" event to read only when more than one records are returned).
    Also I would suggest to implement server filtering in your case - this way the records for the current view will be refreshed faster and the delay will be unnoticeable.

    Regards,
    Vladimir Iliev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Brandon
    Brandon avatar
    1 posts
    Member since:
    Feb 2016

    Posted 11 Mar in reply to Paul Link to this post

    Paul, did you ever come up with a solution for this? I'm attempting to do this right now.
  5. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 15 Mar Link to this post

    Hello Brandon,

    Please note that It's possible to use the dataSource "requestEnd" event to detect when additional records are returned from the server side and use for example the new "pushCreate" method of the dataSource to insert these records in the dataSource. 

    Regards,
    Vladimir Iliev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready