AutoHide toast

I’ve tried adds the autohide but not works. could it be possible to add a delay too? eg: delay: 1000

Global Client Script or in Startup Script (I still haven’t figured out the difference between the two, except for the header and footer position)

//autohide toast bootstrap not wokrs
ew.autoHideSuccessMessage = true;
ew.autoHideSetMessage = true;
ew.autoHideFailureMessage = true;

If you check the source, you’ll find:

GT73 wrote:

ew.autoHideSuccessMessage = true; // this is already the default
ew.autoHideSetMessage = true; // there is no ew.autoHideSetMessage
ew.autoHideFailureMessage = true; // there is no ew.autoHideFailureMessage

To change the auto hide delay for the success message, you may set:

ew.autoHideSuccessMessageDelay = 5000; // 5000 is the default

Client Script is fired when the JavaScripts are loaded. Startup Script is fired when the whole page is loaded.

As arbei mentioned, you can control Toast options from Global > All Pages > Page_Head:

…however, auto-hide only works for success messages. If you want to auto-hide other messages then try something like this in Global > Pages with header/footer > Startup Script:

$(‘.ew-toast’).children(‘.bg-danger, .bg-success’).delay(4000).hide(‘slow’);
–or–
$(‘.toasts-top-right fixed’).children(‘.bg-danger, .bg-success’).delay(4000).hide(‘slow’);

Adam wrote:

Global > Pages with header/footer >
Startup Script:

$(‘.ew-toast’).children(‘.bg-danger, .bg-success’).delay(4000).hide(‘slow’);
–or–
$(‘.toasts-top-right fixed’).children(‘.bg-danger,
.bg-success’).delay(4000).hide(‘slow’);

Thanks
I’ve tried and it’s work so.

$(‘.ew-toast’).delay(3000).hide(‘slow’);
$(‘.toasts-top-right.fixed’).children(‘.bg-warning, .bg-danger, .bg-success’).delay(3000).hide(‘slow’);

now 2021.0.2 it doesn’t work anymore

Inspect the toast element in your browser (F12) and see if classes have changed.