开发者

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] = 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜