search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

How to make an event style as selected on mouse click?

Asked by Rin
6 years ago.

I need to make the events as selected on mouse click and need to change the color to blue as attached. Also need to retain the already applied color on deselection.

Answer posted by Dan Letecky [DayPilot]
6 years ago.

You can change the event background color using onEventClick event handler:

dp.onEventClick = function(args) {
  var e = args.e;
  e.data.backColor = "blue";
  dp.events.update(e);
};

There is also a built-in event selection mechanism but that reverts the styling when you deselect the event:
https://doc.daypilot.org/scheduler/event-selecting/

Comment posted by Rin
6 years ago.

Dear Dan,

The onEventClick is not firing while clicking on the event. And also I need to restrict the multiple event selection and the selection must be removed on clicking on the any other location of the daypilot.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.