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

Customization of Alert popup using HTML

Asked by WS
3 years ago.

Is it possible to customize the alert popup with html tags? I am passing in an array in the alert but I want to customize the way it is shown on the front-end for example I want to use unordered list for better clarity.

I looked at the documentation and so far you can only use CSS to change the look of the box. Can you please guide if that possible?

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

You can use DayPilot.Modal.form() instead to customize the content:
https://api.daypilot.org/daypilot-modal-form/

The following example would display a list:

const form = [
  {text: "Would you like to confirm this list?", type: "html"},
  {html: "<ul><li>item 1</li><li>item 2</li></ul>", type: "html"}
];
const modal = await DayPilot.Modal.form(form);
if (modal.canceled) {
  console.log("canceled");
}
else {
  console.log("confirmed");
}

You can also create the modal dialog content using the UI builder:
https://modal.daypilot.org/builder/

Comment posted by WS
3 years ago.

Is there a way to remove the "Cancel" button on that form? I was able to custom build that form to my needs.

Comment posted by Dan Letecky [DayPilot]
3 years ago.

At this moment there is no special option for that but you can hide it using CSS:

.modal_default_cancel {
    display: none;
}
This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.