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應用程序?也許這將是一個更好的方法。