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

Refresh data in scheduler view every n minutes without user interaction

4 Answers 1478 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Anamika
Top achievements
Rank 1
Anamika asked on 15 Aug 2017, 08:13 AM

Hello,

 

I have a Kendo Scheduler bound to datatable dynamically. The user will have this view open whole day and would like to refresh the data in current view updated every 5/10 minutes as set in some Settings. The user do not Need to interact or refresh the page. Is there some property which i can use or any idea how to achieve a Server read automatically every n minutes and refresh current view.

 

Thanks

 

Anamika

4 Answers, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 16 Aug 2017, 03:33 PM
Hello Anamika,

You can call the Scheduler dataSource's read method every 5 or 10 min by using the setInterval method:
function readData() {
    var scheduler = $("#scheduler").data("kendoScheduler");
  scheduler.dataSource.read();
  scheduler.view(scheduler.view().name)
}
   
(function(){
 setInterval(function (){ readData();}, 300000);
})();

Dojo example in which the read method is called every 5 minutes (300000 milliseconds).

Regards,
Ivan Danchev
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Anamika
Top achievements
Rank 1
answered on 17 Aug 2017, 09:05 AM

Thanks Ivan

0
Mike
Top achievements
Rank 1
Iron
answered on 30 Aug 2018, 07:12 PM

Is there a way to check to see if the custom editor is running (currently open) and only perform the refresh if it isn't open? Otherwise, if someone is in the middle of creating an event it will refresh and the editor closes.

Thanks,

Mike

0
Ivan Danchev
Telerik team
answered on 03 Sep 2018, 12:03 PM
Hello Mike,

You can add the following condition, which checks whether the Scheduler's editor is open, to the readData function:
function readData() {
  var scheduler = $("#scheduler").data("kendoScheduler");
     
  if($(".k-scheduler-edit-form").length == 0) {
    scheduler.dataSource.read();
    scheduler.view(scheduler.view().name);
  }
}


Regards,
Ivan Danchev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Scheduler
Asked by
Anamika
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Anamika
Top achievements
Rank 1
Mike
Top achievements
Rank 1
Iron
Share this question
or