Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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

— asked May 11th 2010 by Manu Kodiyan
  • label
  • tableviewrow
0 Comments

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

    — answered May 11th 2010 by Kosso
    permalink
    0 Comments
  • 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();
        });
    
    — answered May 11th 2010 by Manu Kodiyan
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.