Page 1 of 1

[REACT] Non-working events styling

Posted: Tue Mar 21, 2023 12:16 pm
by sasha573

Hi guys!
We want to allow the user to pick up color for non-working events from color picker and apply changes to gantt, is there a way to change the color of non-working events depending on user selection?
E.g. for tasks we use taskRenderer to change styling, is there anything similar on taskNonWorkingTimeFeature?


Re: [REACT] Non-working events styling

Posted: Tue Mar 21, 2023 12:23 pm
by alex.l

Please check this demo, it shows how to style task non working intervals https://bryntum.com/products/gantt/examples/calendars/
There is also https://bryntum.com/products/gantt/docs/api/Gantt/model/CalendarIntervalModel#field-cls that you can use if you need to have different styling for intervals.


Re: [REACT] Non-working events styling

Posted: Tue Mar 21, 2023 12:36 pm
by sasha573

Hi Alex!
This works perfectly fine if we have pre-defined colors for different calendars and we can assign it to corresponding classes. But if the user would like to pick up random color from color picker in customized gantt toolbar and aplly it to non-working calendar events immediately?


Re: [REACT] Non-working events styling

Posted: Tue Mar 21, 2023 1:25 pm
by alex.l

There is no other instruments, except provided above. You can get CalendarIntervalModel record from calendar and change cls field value.


Re: [REACT] Non-working events styling

Posted: Tue Mar 21, 2023 2:52 pm
by sasha573

Ok, thanks for advice.