Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3] API - Titanium.UI.createTableView

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:50:05.000+0000
Affected Version/sn/a
Fix Version/sGA - M1
ComponentsiOS
Labelsn/a
ReporterNolan Wright
AssigneeReggie Seagraves
Created2011-04-15T02:22:16.000+0000
Updated2011-04-17T01:50:05.000+0000

Description

Description

The purpose of this API is to create a native table view. This is a pure native view and it will be treated similar to createWindow (in that it will have the same properties and functions available to it). In other words, it is not associated with an HTML page.

Example

var tableView = Titanium.UI.createTableView({data:data,rowHeight:'40px'}, function(eventObject) {

});'

tableView.open({animated:true});

Event Object

rowData : the JSON object for the row

section : the section index that was clicked

row : the row index that was clicked within a section

index : the index of the row (section independent)

detail : detail clicked (true|false). this is only valid when a row specifies "hasDetail=true"

API Arguments

object : a JSON object with two possible attributes: data and rowHeight. The 'data' attribute is an array of objects that represents the data required to build the table view (see Data Object detail for definition). The 'rowHeight' attribute represents the height of each table view row. It's optional. The default is 43 pixels in iPhone.

callback : the callback that is executed each time a table row is clicked.

Data Object Detail

title : row title

html : HTML string for creating custom row view. This is used in lieu of title

image : optional. path of an image. Images are placed on the far left side of a row

hasChild : optional. valid values are true|false. indicates that clicking the row will create another window. the default value is false. also, if hasChild is true the default "more icon" should be displayed (e.g., for iphone the ">" would be displayed).

hasDetail : optional. valid values are true|false. indicates that clicking the row will create another window. the default value is false. also, if hasDetail is true, the "detail" icon should be displayed. this option is for iphone only.

header : optional header text for a row (e.g., contacts lists sorted alphabetically)

input : optional instance variable of an input control (e.g., checkbox, slider, input field). Note: the callback responsibility falls onto the input control not the table view.

Comments

  1. Jeff Haynie 2011-04-15

    resolved in 0.5

JSON Source