TableViewRow hasChild not working?
of course it's quite possible I've just lost the plot..
I have
var row = new TableViewRow({hasChild:false,height:50,backgroundColor:rowColor});
Results in this:
(again, I am using Redux (dawsontoth's Appcelerator-Titanium-Redux at master - GitHub http://b-cr.it/e0fYA8)
2 Answers
-
Accepted Answer
Are you developing for iOS? What version of the Titanium SDK are you using?
I have tested this on android with the code below, and get the following result which seems to be as expected:
var win1 = Ti.UI.createWindow({ backgroundColor:'white', navBarHidden:false, title:'This is window 1' }); var data = []; data[0] = Ti.UI.createTableViewRow({hasChild:true,title:'Row 1 - has child'}); data[1] = Ti.UI.createTableViewRow({hasDetail:true,title:'Row 2'}); data[2] = Ti.UI.createTableViewRow({hasCheck:true,title:'Row 3'}); data[3] = Ti.UI.createTableViewRow({title:'Row 4'}); data[4] = Ti.UI.createTableViewRow({hasChild:false,title:'Row 5 - no child'}); // create table view var tableview = Titanium.UI.createTableView({ data:data }); tableview.addEventListener('click', function(e) { var index = e.index; var section = e.section; var row = e.row; var rowdata = e.rowData; Ti.UI.createAlertDialog({ title:'Table View', message:'row ' + row + ' index ' + index + ' section ' + section + ' title ' + rowdata.title}).show(); }); win1.add(tableview); win1.open();
Could you try this on your system, and report back whether it's a bug?
-
Dude.. I just found my issue. (developing for IOS, btw…)
I just found a "row.hasChild=true"
buried in my loop :(
hangs head
thanks for the reply though.. caused me to double look at it..