How to change events css dynamically


#1

Hi,

I need to know how i can manage css class of loaded events on calendar

e.g after when my events are fully loaded on calendar
With any action of OnClick button function, I want to change or add new CSS classes to all events or some specific event.

Also same thing for the the markedTimeSpans to change or add CSS classes with some button click

How can i achieve this ?


#2

Hi,

There is event_class template to update CSS class for the event container dynamically.
https://docs.dhtmlx.com/scheduler/day_view_templates.html
Check the sample https://docs.dhtmlx.com/scheduler/samples/02_customization/01_events_coloring.html
that demonstrates how to update event color according to event subject that user can change in the lightbox. You can use similar approach to add select for colors.

As for markedTimeSpan, it is more complicated. Currently, there is no in-built way to update CSS dynamically. You need to remove marked time span and add almost the same one with new css property.