开发者

Accessing my object properties in an array

开发者 https://www.devze.com 2023-02-25 05:04 出处:网络
var row = Ti.UI.createTableViewRow({height:50}); var rowData = []; row.add(PrimeSuiteUserName); row.add(PrimeSuiteUserPassword);
    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] = Obje开发者_如何学运维ct.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.


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);
0

精彩评论

暂无评论...
验证码 换一张
取 消