Is it possible to trap click event on label in tableViewRow?
I added a label to the kitchen sink example table_view_controls_2.js and tried to add a listener for the 'click' event but it seems to ignore it.
This seems like very basic functionality. Can somebody else drop this file in Kitchen Sink and confirm my result?
Here is my code http://pastie.org/954843. The lines I have added are between '// == Added by JS ==' and '// == End added by JS =='.
I am on Mac OS 10.6.2. Titanium Developer 1.2.1 and Mobile SDK 1.2.0. The iPhone SDK version is 3.1/3.1.2/3.1.3
2 Answers
-
Hi,
It is actually getting caught, but the row event is happening too.
If you add
alert('hello');
inside the label's click event, you'll see it does actually trigger. ;)hth
-
Are you running the same versions as me?
Mac OS 10.6.2. Titanium Developer 1.2.1 and Mobile SDK 1.2.0. The iPhone SDK version is 3.1/3.1.2/3.1.3
I can't get the click event to fire. The click event on the table row does fire.
In fact table_view_controls_2.js in kitchen sink is not working as coded for me. For instance the following code in the original file is not working.
button.addEventListener('click', function(e) { clickLabel.text = 'Button clicked at ' + new Date(); });