Batch Getting Sent Even When Batch is False

4 posts, 0 answers
  1. Jaime
    Jaime avatar
    61 posts
    Member since:
    Mar 2013

    Posted 22 Jul 2014 Link to this post

    Why Doesn't Batch Option Seem to Work
    I am trying to save events to the server. The events are saved but I noticed if I put a break point on the server action the the function is called for every event in the scheduler. The events fail when they have and id set other than zero so. 

    dataSource: { 
        batch:false,
        transport.... }
  2. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2194 posts

    Posted 24 Jul 2014 Link to this post

    Hi Jaime,

    Basically in the scheduler widget when given event is created or updated, the change is immediately synced with the server - that why toggling the "batch" option would make difference only in the format of the data (single event or array with one event in it) that is send to the server.

    Also could you please clarify what exactly do you mean with "The events fail when they have and id set other than zero so"?

    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. Jaime
    Jaime avatar
    61 posts
    Member since:
    Mar 2013

    Posted 24 Jul 2014 in reply to Vladimir Iliev Link to this post

    The events fail because the whole lot are sent to the server one at a time. The event start and end date formats were messed up so the new event items wouldn't save properly. I put in the following code:

    save: function (e) {
        e.event.start = kendo.toString(e.event.start, "u");
        e.event.end = kendo.toString(e.event.end, "u");
    },

    This seemed to fix the event when saving new events to the server. The previous hack is just a hack but whatever. 
    The update events were still getting saved(sent) to the server. However, they would fail because the start and end dates were incorrect.

    I still don't understand your explanation of batch. Why are all the events sent to the server when I want to only create a single one? This doesn't make any sense at all. 

    It is easy enough to ignore events with ids but there is a horrible performance penalty because all the events are sent to the server. 

    if (scheduledTaskModel.Id < 1)
     {
         _scheduledTaskService.Add(scheduledTaskModel);   
     }
  4. Jaime
    Jaime avatar
    61 posts
    Member since:
    Mar 2013

    Posted 24 Jul 2014 in reply to Jaime Link to this post

    I see that batch is only how the list is sent to the server not to limit the list of items. I will no longer be posting on these forums because there is no delete or edit button on them. I often make typos and sometimes I come back and realize my posts don't explain the issue. Having to talk moderator to do this is terrible.

    Telerik should be ashamed for publishing the first user forum ever that doesn't allow users to remove their own posts. 850,000+ posts and still not listening to its users. 
Back to Top