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

How can I make Read execute on date change?

2 Answers 62 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 06 Jul 2015, 06:09 PM

I have a scheduler setup with filters. I have ServerOperation(false) so that my filters can be changed without doing a reload. Lastly, I have the read defined like Read(read => read.Action("Read", "Home").Data("getDateRanges")). The getDateRanges function returns an object with start and end dates.

 When my page loads, all works fine. I can turn on and off filters and watch appointments come and go. No network requests are made for this. When I move from a week view to a day view and back to a week view no network requests happen. All is well. Now, I change weeks, or move to a monthly view. I can only see appointments already loaded. This should have triggered a new Read event but does not.

What can I do to fix this? If I turn ServerOperation to true, then it reloads always even when changing from a week to a day mode.

2 Answers, 1 is accepted

Sort by
0
Paul
Top achievements
Rank 1
answered on 06 Jul 2015, 08:06 PM

I believe I have this figured out. I'm posting information here in case anyone else comes across this. 

I am saving the first and last viewed dates in JavaScript variables. If they are undefined, I retrieve the actual view dates. Then I intercept the navigate handler of the grid. I use the e.date and e.view properties to figure out new starting and ending dates. Then I compare this to the last data loaded. If I am now viewing anything outside the old range, I update my saved variables and call dataSource.read() from the scheduler. I am having trouble getting the appointments to show on the grid, but I'm getting close.

0
Georgi Krustev
Telerik team
answered on 08 Jul 2015, 10:25 AM
Hello Paul,

If I am not missing the case, I believe that you can take a benefit from the "Server filtering" code library, as it shows how to filter the events based on the current visible view: Basically, if you would like to force the reload only on specific cases, then you will need to do that task manually (as you've done that already).

Regards,
Georgi Krustev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Scheduler
Asked by
Paul
Top achievements
Rank 1
Answers by
Paul
Top achievements
Rank 1
Georgi Krustev
Telerik team
Share this question
or