0

我正在尝试使用 Apple 的 Dashcode 组合一个移动网络应用程序。

我想使用圆角矩形列表作为我的用户的菜单界面,但是,我似乎无法更改动态列表中的各个行的标签。

这是我列表的 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 函数改变一些东西,对吧?

有没有人成功使用带有 Dashcode 的 JQuery 来构建 Web 应用程序?也许这会是一个更好的方法。

4

1 回答 1

0

Erm你不会在css而不是javascript中设置圆角矩形吗?

您可以使用 Dashcode 来制作 Web 应用程序,但还有其他选择,实际上现在很多。但是,有一个名为 JQTouch 的 JS 框架,它建立在 JQuery 之上来执行此操作。JQTouch 现在已经被归入 Extjs 并且全部重命名为Sechcha Touch。我建议您将其视为更灵活的选择。

我发现 Dashcode 非常适合构建 Mac 小部件,但对于基于 Web 的 iPxx 应用程序则更有限。

于 2010-08-20T11:17:53.640 回答