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

Batch Getting Sent Even When Batch is False

3 Answers 61 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
jwize
Top achievements
Rank 1
jwize asked on 22 Jul 2014, 09:07 AM
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.... }

3 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 24 Jul 2014, 06:15 AM
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!
 
0
jwize
Top achievements
Rank 1
answered on 24 Jul 2014, 09:28 AM
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);   
 }
0
jwize
Top achievements
Rank 1
answered on 24 Jul 2014, 10:07 AM
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. 
Tags
Scheduler
Asked by
jwize
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
jwize
Top achievements
Rank 1
Share this question
or