Table row with both HasDetails and RightImage?
I'm trying to change the blue image that's added to a tablerow when I set HasDetails to true from blue to red.
If I set the image with rightimage, it does apear. However, a click on the tablerow now longer fires the details flag, so I can't detect a click on the rightimage versus a click on the row itself.
Any way to have these working together?
The click event also doesn't seem to fire it's coordinates, which would provide a workaround.
Currently I can choose between having it working, with the default image, or have a changed image and not working functionality. Any idea's?
The code:
var row = Ti.UI.createTableViewRow({
height:90,
hasDetail:true,
rightImage: 'img/btn_more.png'
});
TableView.addEventListener('click', function(e){
if (e.detail) {
//Details clicked, open that. Only works with no rightimage?!
} else {
//Row clicked
}
});
2 Answers
-
Had the same situation and what I discovered was that when you have a rightImage in place, the 'click' event will return x and y values of 0. Thus:
tableview.addEventListener('click', function(e) { if (e.x == 0 && e.y == 0) { //*** Do the detail action } else { //*** Do the normal click action } });
-
I think you will have to build a custom row for this, and detect the click on the image.