How to repaint scheduler?

Hi all,

i have calender with blocked times. and when change the view (day, week, unit, …) new data cannot be reloaded. it can only be repainted, if i clicked the selected view again OR resize the window.

how can i do repaint in dhtmlxscheduler with blocked times?

NO ANSWER?

Hello,

Can you explain in detail what’s happening? How do you block time, what is “data”, why should it be reloaded?

Generally to refresh current view you can use
scheduler.setCurrentView();
But please note that it is called either way then you navigate between views.

Kind regards,
Ilya

the way i used to block specific times on calendar is as follows:

scheduler.blockTime(any_date, [0,360,900,1440]);

“data” is blocked and unblocked time intervals of calendar.

there are numerous blocked and blocked time intervals on different dates. when i change the view to the next day or week, the view remains same as the day before. it should be redrawn.

because i am blocking calendar in the onViewChanged event, if i used scheduler.setCurrentView(), it calls the onViewChanged function again. so it causes an infinite loop.

scheduler.attachEvent("onEventChanged", function(event_id,event_object){ ... scheduler.blockTime(any_date, any_time); ... scheduler.setCurrentView(); }

sorry. the following code is correct.

scheduler.attachEvent(“onViewChange”, function (mode, date){

scheduler.blockTime(any_date, any_time);

scheduler.setCurrentView();
}

scheduler.attachEvent("onViewChange", function (mode, date){ ... scheduler.blockTime(any_date, any_time); ... scheduler.setCurrentView(); }

Hello,

You can try following options:

  1. Call blockTime in the onBeforeViewChange event. Remember to return true to allow view change.
  2. Call scheduler.update_view() instead of scheduler.setCurrentView(); It won’t call onViewChange event but that’s not a public API for now.

Best regards,
Ilya