In Titanium how do I execute a button click event from code?
Question
I tried
btn.click();
And the error message is 'Cannot call property click in object ti.modules.titanium.ui.ButtonProxy@44f61. It is not a function, it is "object"'
Solution
btn.fireEvent('click');
this should work
OTHER TIPS
btn.addEventListener('click',function() {
Titanium.API.info('Button Clicked');
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow