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

[Solved] Kendo Scheduler Refresh after updating datasource

1 Answer 751 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Markus
Top achievements
Rank 1
Markus asked on 02 Mar 2015, 10:15 AM
Hi

I have following example (modified original demo from Kendo Scheduler):

http://dojo.telerik.com/AkIGO

In this example I create a data array with two events which are displayed properly on the scheduler view on the right side.

    var data = [{ TaskID: 0, OwnerID: 1, Title: "Bowling tournament 6", Start: "2013-06-10T10:30:00", End: "2013-06-10T11:30:00", IsAllDay: false},{ TaskID: 1, OwnerID: 2, Title: "Golf", Start: "2013-06-11T10:30:00", End: "2013-06-11T11:30:00", IsAllDay: false}];

I have included a button, which event I catch and then extend this "data" array with one more element like this:

    data.push({ TaskID: 2, OwnerID: 3, Title: "New Event", Start: "2013-06-12T10:30:00", End: "2013-06-12T11:30:00", IsAllDay: false});
    console.log(data);

The console.log of the array confirms the addition. I hence call the following refresh code:

$("#scheduler").data("kendoScheduler").refresh();

...which does not update my scheduler view on the right to include the new event (created for wednesday 6/12).

I have also tried:

    $('#scheduler').data('kendoScheduler').dataSource.read();

but this results in an error.

Any ideas?

1 Answer, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 04 Mar 2015, 08:04 AM
Hi Markus,

The correct way of inserting new items after the scheduler is initialized is to use it's dataSource API methods:

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Markus
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Share this question
or