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

Evento useless in shade

Asked by Santiago Losada Borrajo
1 year ago.

When I click on a cell or drag the mouse over several cells, they are highlighted and shaded, which means that if there is an event below, you cannot click on the event. How can it be solved, to shade that area or not and for the event to be released or for the event to be a priority.

Answer posted by Dan Letecky [DayPilot]
1 year ago.

You can disable time range selecting using the config:

{
  timeRangeSelectedHandling: "Disabled",
  // ...
}

If you want to use this feature to create new events, it is necessary to call clearSelection() after you process the event.

Here is an example:

{
  timeRangeSelectedHandling: "Enabled",
  onTimeRangeSelected: async (args) => {
    const modal = await DayPilot.Modal.prompt("Create a new event:", "Event 1");
    const dp = args.control;
    dp.clearSelection();
    if (modal.canceled) { return; }
    dp.events.add({
      start: args.start,
      end: args.end,
      id: DayPilot.guid(),
      text: modal.result
    });
  },
}

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