Bug or Doc Error: AlertDialog click event properties
Hey all. just posting something I noticed today.
a.addEventListener('click', function(e)
{
Ti.API.info(e.cancel);
});
in the docs, the "cancel" property is said to be "boolean to indicate if the cancel button was pressed". But it returns the index for the cancel button instead. Just a heads up.
5 Answers
-
To bring attention to this again, this still seems to be a problem in 1.7.2.
You can illustrate the issue by making the cancel button index 0. When you test e.cancel, it will return '0', and since 0 is falsey, something like
if(e.cancel)
doesn't work, because it never returns true. -
Just for attention. It's still there in 1.7.5.
-
Still happening in 1.8.0.1
It appears to be an issue for option dialogs as well
-
Just noticed the same problem. I'm not sure if the documentation or the implementation is wrong. I guess I'll have to just check a magic index property for now :(
-
Complete Solution provided here.
http://developer.appcelerator.com/question/87471/alertdialog-actions