Change color of selected event temporarily in all Views

I want to change the color of event when it is selected (clicked by mouse): Already tried 2 things:

  1. scheduler.templates.event_class = function (start, end, event) {
             var css = "";
             if (event.id == scheduler.getState().select_id) { css += " selected"; }
             return css;
         };
    
  2. scheduler.for_rendered(id, updateCSS);
    function updateCSS(event) {
    event.style.color = ‘white’;
    event.style.backgroundColor = ‘#444d58’;
    }

Both are working only in Month View. I also want to do same in Unit View and Week View.

Hi,

I tried to reproduce the problem using the first way and events in unit and week views are highlighted too. Please check it here: docs.dhtmlx.com/scheduler/snippet/4651d75d

O yes i missed the classes ! It solved the issue.