0

null データ バインディングの問題のプロパティ '__transform' を読み取ることができないというエラーが表示されます。

リソース セクションの対応するエラーのコード行:

text: "undefined" != typeof $model.__transform["topic"] ? $model.__transform["topic"] : $model.get("topic")

どういうわけかモデルが正しく参照されていないと思います。これが私のモデルコードです。models ディレクトリのファイル chatThreadSQL.js にあります。

exports.definition = {
config: {
    "columns": {
    "uuid":"TEXT UNIQUE PRIMARY KEY",
    "topic": "TEXT", 
    "created":"TEXT",
    //"patient": "",
    },
adapter: {
    "type": "sql",
    "collection_name": "chatThreadSQL_col",
    // idAttribute tells Alloy/Backbone to use this column in
    // my table as its unique identifier field. Without
    // specifying this, Alloy's default behavior is to create
    // and "alloy_id" field which will uniquely identify your
    // rows in the table with a text GUID.
    "idAttribute": "uuid"
    }
},  

extendModel: function(Model) {  
    _.extend(Model.prototype, {

        // extended functions go here

    }); // end extend

    return Model;
},


extendCollection: function(Collection) {    
    _.extend(Collection.prototype, {

        // extended functions go here

    }); // end extend

    return Collection;
}

};

adb シェルを使用して、データが sqlite3 に挿入されていることを確認しました。

ビューファイルchatHome.xmlのビュー定義は次のとおりです

   <TableView dataCollection="chatThreadSQL"  id="table2">
        <TableViewSection>
        <TableViewRow id="row" title="{topic}" onClick="openChats" model="{uuid}" backgroundSelectedColor="#000080">
            <Label id="title" text="{topic}"/>
            <Label id="date" text="{date}"/>
        </TableViewRow>
        </TableViewSection>
   </TableView>

controllers/chatHome.js では、ファイルの先頭に次の行があります。

var chatThreads = Alloy.Collections.chatThreadSQL;

どんなポインタでも大歓迎です!

他の情報:

Application type: mobile
Titanium SDK: 3.1.3
Platform & version: Android 4.
Host Operating System: Ubuntu 13.04
4

1 に答える 1