Show or hide hour scale from 12.00am to 8:00 am

Hi,

I set scheduler.config.first_hour = 8. Now the hour scale is set to 8 am, thats perfect. But if want to see events that are scheduled before 8:00 am what should i do?. Is there a way in dhtml scheduler to have button like hide/show to show or hide events that are scheduled before 8:00 am? Is it possible to show or hide hour scale from 12.00am to 8:00 am? I need your help on this.

Thanks and Regards,
Karthick K.

You can place some kind of custom button and call from it

scheduler.config.first_hour = 0; scheduler.setCurrentView(scheduler.getState().date);

which will repaing scheduler with new first_hour

Hi Stanislav,

Thanks for the solution. That worked like a charm. But i have one more question to ask. Is there a way to change a button’s label dynamically like changing the hour scale in scheduler? What i mean here is, i have a custom button called "show previous " when you click it, the hour scale will be set 0. At the same i want the button label also should be changed to something like “Show Default View” to go back to 8 am. By this i can avoid having two buttons.

I tried something like this to change button’s label dynamically but it is not working,
scheduler.locale.labels.dhx_custom_button_show_hide = “Show Default”;

Can you help me with this?

Thanks
Karthick K.

Normally scheduler doesn’t repaint the element of iterface, except of data items.
If this button is part of header - it can be changed only through DOM
If it is a part of lightbox, you can use resetLightbox to force repainting ( it will not repaint lightbox immediately , but only during next lightbox activation )

In case of button in lightbox you can check button_click in sources/recurring.js - it shows how text can be changed

Hi Stanislav,

I used DOM to change the label value and it worked. Thank you very much for your support.

Thanks,
Karthick K.