jQWidgets Forums
jQuery UI Widgets › Forums › Scheduler › how to refresh the data
Tagged: javascript scheduler, jquery scheduler, scheduler
This topic contains 6 replies, has 5 voices, and was last updated by Adamt 9 years ago.
-
Authorhow to refresh the data Posts
-
Hi,
Is there a method like ‘refresh’ to update the appointments?
Thanks.Hi aykutucar,
Why is it necessary to refresh them? If you rebind the Scheduler, it will update the appointments as well.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/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.
Hi SteveV,
When you rebind the Scheduler, it re-renders itself so you will lose the scroll position.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/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
Hi SteveV,
The Scheduler has addAppointment method which allows you to add an appointment.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/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 *2Create 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
-
AuthorPosts
You must be logged in to reply to this topic.