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

Use method on click (Calendar)

Asked by Arthur
1 month ago.


When I'm clicking on an empty space, a modal appears. I want to know if it's possible to change it by using a method (already created) that will use my modal (already created in vue) with the date selected ?
It will be really helpful for me because it will directly communicate with my database.

Thanks in advance.

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

Yes - you should take a look at the onTimeRangeSelected event handler in your application.

By default, the calendar doesn't do anything when you select a time range (click a cell) so if you see a modal dialog there is already an onTimeRangeSelected handler that opens it. You can modify it as needed and open your own modal dialog instead.

Usually, it looks like this:

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

See also:

New Reply
This reply is
or drop files here
Your name (optional):