Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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)

— asked December 2nd 2010 by Critter
  • haschild
  • tableviewrow
0 Comments

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:

    screenshot

    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?

    — answered December 3rd 2010 by Paul Dowsett
    permalink
    0 Comments
  • 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..

    — answered December 3rd 2010 by Critter
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.