2010-08-17 34 views
0

我試圖把使用蘋果的Dashcode的移動web應用程序放在一起。Dashcode移動web應用程序動態列表行標籤

我想使用圓角矩形列表作爲我的用戶的菜單界面,但是,我似乎無法更改動態列表中的各行標籤。

這裏是我的列表中的javascript:

var dayController = { 

/* categoryList will display these items */ 
_rowData: ["iPods", "Macs", "Applications"], 

/* categoryListController must implement the numberOfRows and prepareRow functions */ 
/* This method is used to find out how many rows should be in the list */ 
numberOfRows: function() { 
    return this._rowData.length; 
}, 


/* categoryList calls this method once for every row. */ 
prepareRow: function(rowElement, rowIndex, templateElements) { 
    /* 
     templateElements contains references to all elements that have an id in the category template row. 
     We use the lines below to update the list with each category item in _rowData. 
    */ 
    if (templateElements.categoryLabel) { 
     templateElements.categoryLabel.innerText = this._rowData[rowIndex]; 
    } 

    /* Assign an onclick handler that will cause the browser to go a page 
     showing all products related to this category item, when clicked 
    */ 
    var self = this; 
    var handler = function() { 
     /* Get the category item associated with this row */ 
     var category = self._rowData[rowIndex]; 

    }; 
    rowElement.onclick = handler; 
} 

};

我想能夠分配rowData []作爲列表中的行的標籤,但我似乎無法讓它工作。

我猜我需要改變prepareRow函數,對吧?

有沒有人成功地使用Jash和Dashcode來構建一個Web應用程序?也許這將是一個更好的方法。

回答

0

Erm不會在CSS中設置圓角矩形而不是JavaScript?

您可以使用Dashcode製作網頁應用程序,但還有其他替代方法,而現在其實很多。然而,有一個名爲JQTouch的JS框架,它建立在JQuery之上,用於實現這一點。 JQTouch現在已經融入到Extjs中,並全部重命名爲Sechcha。我建議你把它看作更靈活的選擇。

我發現Dashcode非常適合構建Mac Widget,但是對於基於Web的iPxx應用程序來說,它更受限制。