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!