Titanium Community Questions & Answer Archive

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

createTableViewRow and createTableView?

Hi,

I am new to Titanium mobile but i cant find out when I should use createTableViewRow or createTableView. Both have the "data" propriety, so, in teory i can achieve the same results creating a tableview. There is some guideline about this? When I should use one and when I should use the other?

Thanks in advance

— asked November 22nd 2010 by Daniel Ander
  • createtableview
  • createtableviewrow
0 Comments

1 Answer

  • Accepted Answer

    Hi Daniel

    You have two choices when creating at table; to create an array of objects with simple tableViewRow attributes and pass it directly to createTableView, as shown in the KitchenSink's table_view_basic.js and table_view_layout.js scripts, or to create an array of tableViewRow objects, which may contain complex layouts including views such as labels, buttons and pickers etc, and pass this to createTableView, as shown in table_view_layout_2.js.

    Really, createTableView just creates a tableViewRow for every item in its data array, but does not allow you to add child views to each of those tableViewRows.

    I hope this explanation is clear. Let me know if not.

    — answered November 22nd 2010 by Paul Dowsett
    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.