Titanium Community Questions & Answer Archive

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

No right arrow on iPhone tableview

Don't know if its a coding thing, but I thought that the arrow would be added automatically.

My tableview lists the values, and then when I click it it animates and opens up another window.

Any reason why this isn't showing, or do I need to add a property?

var tableview = Titanium.UI.createTableView({
    data:data,
    editable:true,
    backgroundColor:'#ffffff',
    fontColor:'#000000',
    fontSize:9,
    top:0
});
— asked October 25th 2010 by Josh Lewis
  • arrow
  • iphone
  • tableview
0 Comments

10 Answers

  • Accepted Answer

    var data = [];
    
    
    //Get data for tableview
    var rows = db.execute('SELECT * FROM fishingspots');
    while (rows.isValidRow()) {
      data.push({
                        id: rows.fieldByName('id'),
                        lat: rows.fieldByName('lat'),
                        lon: rows.fieldByName('lon'),
                        title: rows.fieldByName('caption'),
                        info: rows.fieldByName('info'),
                        hasChild: true
      });
        rows.next();
    }
    rows.close();
    

    This should work

    — answered October 25th 2010 by Abraham Vivas
    permalink
    2 Comments
    • Oh, thats all? I thought there was more to it using the createtablerow

      — commented October 25th 2010 by Josh Lewis
    • What you are pushing into the data is a dictionary that will be used to create a tableViewRow so it also works this way

      — commented October 25th 2010 by Abraham Vivas
  • If you want the arrow to display you must add the "hasChild" attribute to each row:

    var someRow = Titanium.UI.createTableViewRow({
         height:46, 
         title:'My Text', 
         hasChild:true
    });
    
    — answered October 25th 2010 by Abraham Vivas
    permalink
    0 Comments
  • So I'll have to programmatically create rows during my loop when I get the details? I'm not using the createTableViewRow at all

    — answered October 25th 2010 by Josh Lewis
    permalink
    0 Comments
  • So I'll have to programmatically create rows during my loop when I get the details? I'm not using the createTableViewRow at all

    — answered October 25th 2010 by Josh Lewis
    permalink
    0 Comments
  • So I'll have to programmatically create rows during my loop when I get the details? I'm not using the createTableViewRow at all

    — answered October 25th 2010 by Josh Lewis
    permalink
    0 Comments
  • So I'll have to programmatically create rows during my loop when I get the details? I'm not using the createTableViewRow at all

    — answered October 25th 2010 by Josh Lewis
    permalink
    0 Comments
  • No you can include that in your data variable.

    — answered October 25th 2010 by Abraham Vivas
    permalink
    0 Comments
  • Good lord, why are there 4 answers of mine that are the same??

    — answered October 25th 2010 by Josh Lewis
    permalink
    0 Comments
  • Could you provide an examples based on my code? Here is the code that actually adds to the table

    var data = [];
    
    
    //Get data for tableview
    var rows = db.execute('SELECT * FROM fishingspots');
    while (rows.isValidRow()) {
      data.push({
                          id: rows.fieldByName('id'),
                          lat: rows.fieldByName('lat'),
                        lon: rows.fieldByName('lon'),
                        title: rows.fieldByName('caption'),
                        info: rows.fieldByName('info')
      });
        rows.next();
    }
    rows.close();
    
    — answered October 25th 2010 by Josh Lewis
    permalink
    0 Comments
  • Could you provide an examples based on my code? Here is the code that actually adds to the table

    var data = [];
    
    
    //Get data for tableview
    var rows = db.execute('SELECT * FROM fishingspots');
    while (rows.isValidRow()) {
      data.push({
                          id: rows.fieldByName('id'),
                          lat: rows.fieldByName('lat'),
                        lon: rows.fieldByName('lon'),
                        title: rows.fieldByName('caption'),
                        info: rows.fieldByName('info')
      });
        rows.next();
    }
    rows.close();
    
    — answered October 25th 2010 by Josh Lewis
    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.