0

Apple の 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 関数で何かを変更する必要があると思いますよね?

Dashcode で JQuery を使用して Web アプリを構築した人はいますか? おそらくそれはより良いアプローチでしょう。

4

1 に答える 1

0

ええと、丸みを帯びた長方形をJavaScriptではなくCSSに設定しませんか?

Dashcode を使用して Web アプリを作成することもできますが、他の方法もあり、最近ではかなり多くなっています。しかし、これを行うために JQuery の上に構築された JQTouch と呼ばれる JS フレームワークがありました。JQTouch は Extjs に組み込まれ、そのすべてがSechcha Touch に改名されました。より柔軟な代替手段として、それを検討することをお勧めします。

Dashcode は Mac ウィジェットの構築には優れていますが、Web ベースの iPxx アプリにははるかに制限されていることがわかりました。

于 2010-08-20T11:17:53.640 に答える