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
2 months 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]
2 months 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
2 months 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.

New Reply
This reply is
Your name (optional):