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

Red color for the Message

Asked by Naomi
3 months ago.

Hi,

We're using the Day Pilot message to communicate some information to the user using its default Yellow color. I'm wondering what should I do if I need to show error messages in certain cases? We currently are using Toastr, but I'd like the interface to be consistent and use Day Pilot messages instead.

Thanks in advance.

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

It's possible to change the background color using CSS.

1. You can create a custom theme:
https://themes.daypilot.org/scheduler/create

2. You can override the background color specified using the default theme:

#dp .scheduler_default_message { color: #ffffff;background: #red; }

Please note that #dp is added to the selector to make it more specific so it will override the theme.

3. You can add custom CSS class to the message bar when you display the message:


dp.message("Hi there!", { cssClass: "red" });

.red.scheduler_default_message { color: #ffffff;background: #red; }

Comment posted by Naomi
3 months ago.

Thanks a lot, Dan. Right after I posted this message my colleague posted the implementation using the 3rd method. I like it as I think it gives the most flexibility. It would be nice to see it in documentation too, because I spent some time trying to find it in the documentation first before posting.

Comment posted by Naomi
3 months ago.

Can I apply both cssClass and also longer timeout?

Comment posted by Naomi
3 months ago.

In other words, I can see I can use this https://api.daypilot.org/daypilot-scheduler-messagehideafter/ but I only want to alter the timeout for error messages. It would be nice to be able to specify one extra parameter (in addition to the class) in the message method for timeout.

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