How can I make Read execute on date change?

3 posts, 0 answers
  1. Paul
    Paul avatar
    96 posts
    Member since:
    Jun 2010

    Posted 06 Jul 2015 Link to this post

    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. Paul
    Paul avatar
    96 posts
    Member since:
    Jun 2010

    Posted 06 Jul 2015 in reply to Paul Link to this post

    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 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 from the scheduler. I am having trouble getting the appointments to show on the grid, but I'm getting close.

  3. UI for ASP.NET AJAX banner
  4. Georgi Krustev
    Georgi Krustev avatar
    3687 posts

    Posted 08 Jul 2015 Link to this post

    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).

    Georgi Krustev
    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
Back to Top