I have a TableView with checkboxes inside the rows. The click event on the rows is not firing and the row is not selected on touch, even though touchEnabled is set to false for the chechboxes:
var createRow = function(item) { var tablerow = Ti.UI.createTableViewRow({ className: 'itemRow', height:'auto', touchEnabled : true }); var checkBox = Ti.UI.createSwitch({ style: Ti.UI.Android.SWITCH_STYLE_CHECKBOX, value:false, left: 5, touchEnabled: false }); var textLabel = Titanium.UI.createLabel({ touchEnabled : false, text:item.title, height:'auto', left:'25%' }); tablerow.add(checkBox); tablerow.add(textLabel); return tablerow; };
1 Answer
Your event listener should be on the tableview, not the individual tableviewrows. Look at the event parameters of the click callback function, if I recall it will give a source property or something like that, which would let you see what exactly was clicked, either the row or the checkbox.
Also make sure you have zIndex set on the checkbox, just for kicks.
If those suggestions don't work then you may want to fake it, by creating a scrollview with views in it instead of a tableview.
Your Answer
Think you can help? Login to answer this question!