Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Tim Sanders on Sep 03, 2009 14:09
open dhtmlx forum
Scheduler Highlight Current Event

Is there a way to highlight the current selected event by giving it a different color? When the lightbox is displayed it is difficult to tell which event in the calendar has been selected.

Thank you.
Answer posted by Support on Sep 04, 2009 00:59
 You can use a code similar to the next

.custom_selected, .custom_selected div{
    background-color:red !important;
}


scheduler.attachEvent("onBeforeLightbox",function(id){
    scheduler.for_rendered(id,function(r){
          r.className+=" custom_selected";
    })
    return true;
});

scheduler.attachEvent("onEventCancel",function(id){
    scheduler.updateEvent(id); 
    return true;
}

Answer posted by Benjamin on Oct 06, 2009 05:52
But is there also any way to automaticly highlight the CURRENT event?
Mean, the event takes place right now, at this minute?
Answer posted by Stanislav (support) on Oct 06, 2009 06:47
Can be done through templates

.current_event, .current_event div{
         background-color:red !important;
}


scheduler.templates.event_class=function(start,end,event){
   if (start < (new Date()) && end > (new Date()))  //current event
            return "current_event"; //set special css class for it
}
Answer posted by Benjamin on Oct 06, 2009 07:43
Great Support over here !
Will have try... THX