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.
Simple dialog question (ons confirm button)
-
Hi all,
This is my code:
ons.notification.confirm({title: message_title ,message: message_content}) .then(function() {ReallyDelete();});
If the user presses ‘cancel’, the function ReallyDelete is still called. How can I make it cancel the dialog, when cancel is clicked…?
Thanks!
-
@Remco-Koffijberg From the docs:
Returns: Will resolve to the index of the button that was pressed.
. So you are getting a value:function(index) { if (index === 0) { ReallyDelete(); }
. It depneds on the order of your buttons, just check the returned value.
-
Aha! I read it, but didn’t understand. Tx!
-
It worked! (–;
-
This post is deleted!