theJava
theJava

Reputation: 15034

Accessing my object properties in an array

    var row = Ti.UI.createTableViewRow({height:50});
    var rowData = [];
    row.add(PrimeSuiteUserName);
    row.add(PrimeSuiteUserPassword);
    Ti.API.info("HelloRow" +row);
    rowData[0] = Object.property1;
    rowData[1] = Object.property1;
    Ti.API.info("Hello" +rowData);

When i alert down my row object i get this...

HelloRow[Ti.UI.TableViewRow]

How can i access my row object property in my array.

Upvotes: 0

Views: 395

Answers (1)

mkind
mkind

Reputation: 2043

try this.

// section index
var sectionIndex = 0;

// row index
var rowIndex = 0

// without label or childfield
rowtitle = yourTableView.data[sectionIndex].rows[rowIndex].title;
Ti.API.info("HelloRow " +rowtitle);

// child index
var childIndex = 0;

// with label or childfield
var text = yourTableView.data[sectionIndex].rows[rowIndex].children[childIndex].text;
Ti.API.info("HelloRow " +text);

Upvotes: 1

Related Questions