clicking on the button of a tableviewrow triggers just the event for clicking the whole row...why?

You must Login before you can answer or comment on any questions.

I am trying to acomplish the folowing I have 2 buttons on the right and some text on the left of each row

I want different events when taping on each one...but the whole tablerow selects itself...then deselects iself...

1 Answer

Accepted Answer

try:

table.addEventListener('click',function(e){
alert(e.source);
// if e.source is Ti.UI.Button then perform whatever you want
});

— answered 1 year ago by Gagan Tiwari
answer permalink
1 Comment
  • you can set your own property to button and access them during the events such as :

    var select = Ti.UI.createButton({
    name : 'selectButton'
    //other specifications
    });
     
     
    var deselect = Ti.UI.createButton({
    name : 'deselectButton'
    //other specifications
    });
     
    table.addEventListener('click',function(e){
    if(e.source.name == 'selectButton'){
    //perform 
    }
    });

    — commented 1 year ago by Gagan Tiwari

Your Answer

Think you can help? Login to answer this question!