Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
closing an ons.notification?
-
Hey all. If I’ve called ons.notification.alert, is it possible to close it programmatically, rather than have it stay on the screen until the user clicks ‘OK’?
Thanks,
Scott
-
@sherscher Absolutely. The docs here do a good job of showing the hide method.
-
@sherscher Basically you can get the element by ID (check
options.id
) and then callhide
as @munsterlander says.
-
Ah! Thanks for that. That’s significantly more elegant than what I concocted. I got the OK button element, and called click() on it. It worked, but I’ll change it to use hide().
Thanks,
Scott
-
@fran-diox please can you give an example
i am having an issue closing ons.notification.confirm
when i am on the home page and user click on the back button i am asking him if he want to close the app or not , if yes i am closing the app , if not the notification close .my problem is if the user click multiple times on the back button multiple notification boxes are showing up for him , please help me know how i can prevent this