style templates


I’m looking for a way to make dhtmlxScheduler more dynamic. Is there a way you could enable for example scheduler.templates.month_date_style template? I know there are class templates but for my case they are simply not enough.

  • I don’t know classes in advance
  • it’s complicated to make css rules that override default properties (higher css specificity) and make them work for all views
  • styles (if used cautiously) are simply the most convenient for the job

Currenty I have no choice, other than inject style atrributes:

scheduler.templates.month_date_class = function(date){ return "' style='background-color:#ff3421' dummy='"; };

Is this something you will abolish in the future?

Any thoughts?


Unfortunately, currently scheduler doesn’t have such templates.
In case of month_date_class, possibly you could try to use “onScaleAdd” event handler.
See article: … event.html
Possibly, you could try to add css classes dynamically, but it doesn’t seems like good solution. Maybe if you have some fixed range of styles you could generate it before initialization and then use it.