jQWidgets Forums

jQuery UI Widgets Forums Scheduler how to refresh the data

This topic contains 6 replies, has 5 voices, and was last updated by  Adamt 9 years ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • how to refresh the data #77098

    aykutucar
    Participant

    Hi,
    Is there a method like ‘refresh’ to update the appointments?
    Thanks.

    how to refresh the data #77100

    Peter Stoev
    Keymaster

    Hi aykutucar,

    Why is it necessary to refresh them? If you rebind the Scheduler, it will update the appointments as well.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    how to refresh the data #84075

    SteveV
    Participant

    Hi Peter, I’m piggybacking on this thread because I have a similar question. We are updating the scheduler display from an external source using SignalR and re-binding. This works, it reloads the scheduler but the screen returns to the top so any user that has scrolled down to somewhere in the middle has now lost their place.

    Is there a way to re-bind but maintain the users viewable area or scroll position?

    Thanks.

    how to refresh the data #84084

    admin
    Keymaster

    Hi SteveV,

    When you rebind the Scheduler, it re-renders itself so you will lose the scroll position.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    how to refresh the data #84112

    SteveV
    Participant

    Thanks Peter, do you have any thoughts on how we can dynamically add an appointment without requiring a re-bind and repositioning of the users view?

    Is there a knockout based approach where we just modify the appointment collection and it pulls in the new list without an explicit re-bind?

    Thanks

    how to refresh the data #84117

    Peter Stoev
    Keymaster

    Hi SteveV,

    The Scheduler has addAppointment method which allows you to add an appointment.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    how to refresh the data #84175

    Adamt
    Participant

    Hi SteveV,

    I have faced with the similar problem. Here is what I have done to solve the scrolling issue.

    Before I re-bind the scheduler I store the current scroll position based on the appointment’s start hour in a global variable like this:

    var timefrom = new $.jqx.date($(‘#scheduler’).jqxScheduler(‘getAppointmentProperty’, appointment.id, ‘from’));
    scrollposition = $(‘#scheduler’).jqxScheduler(‘rowsHeight’) * 4 * timefrom.hour();
    // *4 because I use 15 minutes divisions, if you use 30 minutes division the use *2

    Create the binding complete event for the scheduler:

    $(‘#scheduler’).on(‘bindingComplete’, function (event) {
    $(“#scheduler”).jqxScheduler(‘scrollTop’, 0);
    if (scrollposition > 0) {
    $(“#scheduler”).jqxScheduler(‘scrollTop’, scrollposition);
    scrollposition = 0;
    }
    });

    It’s working for me. If you have any problem let me know.

    Adam

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.