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

How to refresh and reload kendo UI scheduler

3 Answers 1023 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Lilan
Top achievements
Rank 2
Lilan asked on 23 Jul 2015, 10:17 AM

Hello, 

 I want to refresh and reload kendo UI scheduler with new data after it was initialized.  Please find configuration as below. 

 <div id="schedulerTimeLine" kendo-scheduler k-options="schedulerTimeLineOptions"></div>

$scope.schedulerTimeLineOptions was set when the page is loaded and then I want to change the configurations of $scope.schedulerTimeLineOptions later and I will update the scope. So even after I updated $scope.schedulerTimeLineOptions scheduler doesn't load new data.

So I want to refresh and reload the kendo UI scheduler which I could not find a solution. 

 

Please Help

Thanks, 

Lilan

3 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 27 Jul 2015, 08:17 AM
Hi Lilan,

According to this help article if you need to update the widget dataSource data through the scope than you should wrap it in Observable array before binding it to the widget. For your convenience I created small example which shows how the desired behavior can be achieved:

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
Lilan
Top achievements
Rank 2
answered on 27 Jul 2015, 08:58 AM

Dear Vladimir , 

Thanks a lot for your update and actually what I needed is lets say, I have a button call "Reset Resources", when the loading time there will be 11 resources("Priest" -please see the code in dojo) in scheduler and when you click, It will change the scheduler starting date and reload the resources ("Priests" and "color")  with newly added color and priest in the resources list. 

Please find sample application in Dojo. If you could modify this and give me a direction will be a great help.

 

Thanks, 

Lilan

 

 

 

0
Accepted
Vladimir Iliev
Telerik team
answered on 29 Jul 2015, 07:56 AM
Hi Lilan,

As starting point you can use the following "reset resources" function for the "Priests" resource:

resource data:
$scope.priestsData = new kendo.data.ObservableArray([{"text":"Demo  Prest"......

resource definition:
resources: [{
    field: "priest",
    name: "Priests",
    dataSource: $scope.priestsData,
    multiple: true,
    title: "Priests"

reset resources:
$scope.resetResources = function () {
    $scope.priestsData.push({text: "NEW PRIEST", value: "11111", OrderIndex: 222222});
    var scheduler = $("[data-role=scheduler]").getKendoScheduler();
    //reload current view
    scheduler.view(scheduler.view().name);
};

Also here can be found the updated example.

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
General Discussions
Asked by
Lilan
Top achievements
Rank 2
Answers by
Vladimir Iliev
Telerik team
Lilan
Top achievements
Rank 2
Share this question
or