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