2011-04-17 50 views
0
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); 

當我提醒了我行對象我得到這個...訪問我的對象屬性陣列中的

HelloRow[Ti.UI.TableViewRow] 

如何訪問我行對象屬性在我的陣列。

+0

當你說'我的數組'你的意思是'rowData'數組嗎?我也不確定你爲什麼讀'Object.property1',你的意思是'我的行對象屬性'。 – 2011-04-17 15:48:00

+0

我想保存我的rowData數組中的對象值 – theJava 2011-04-17 17:44:58

+0

我還是不遵循,對不起。也許別人會理解和幫助。 – 2011-04-17 18:15:34

回答

1

試試這個。

// 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

如何訪問一行的selectedIndex – theJava 2011-04-19 07:14:42

+0

yourTableView.addEventListener('click',function(e){selectedRowIndex = e.index;}) – mkind 2011-04-20 08:36:34