android - Stopping event listener of tableviewrow in Titanium -
when user click on tableviewrow, alert box 'row' occur. , inside tableviewrow, contains view contains image view. alert box 'label' popout when user click on image. problem when user click on image, not alert box 'label' popup, alert box 'row' too. how can avoid alert box 'row' popping out when user click on image? alert box 'row' appear when user click on tableviewrow other image. thanks..
var row = titanium.ui.createtableviewrow({ classname:'rowclass', }); var u_image = titanium.ui.createimageview({ image: 'image.jpg', top:10, left:4, height:36, width:36, }); row.add(u_image); regdata.push(row); u_image.addeventlistener('click', function(e){ alert('label'); }); row.addeventlistener('click', function(e){ alert('row'); });
ti 1.6, android 2.2
create image view id
var u_image = titanium.ui.createimageview({ image: 'image.jpg', id: "image_view", top:10, left:4, height:36, width:36, });
put listener on whole table , not specific elements
mytable.addeventlistener('click', function(e){ if(e.source.id == "image_view") { alert('image_view'); } else { alert('row'); } });
Comments
Post a Comment