No config.adapter.idAttribute specified for table "books" in the Titanium Appcelerator

I am new to appcelerator. And, following the quick start guide, I cannot create an assembly on an iOS simulator, even after you have precisely copied the code in the required models and controllers. The console gives me the following information:

  • There is no config.adapter.idAttribute attribute for the "books" table
  • Adding "alloy_id" to uniquely identify strings

The simulator stops at the default screen saver, and nothing happens after that. Can the gurus go through me?

+4
source share
3 answers

Are you stuck in the first build phase? If yes, then check my answer here:

Appcelerator Dev - favebooks

, , , , , index.js index.xml, .

+3

/index.js, , , , , doClick(). $.index.open(); , config.adapter.idAttribute, "books"

:

var myBooks = Alloy.Collections.books;
var book = Alloy.createModel('books', { 
 title : 'Great Expectations', 
 author: 'Charles Dickens' 
});
myBooks.add(book); 
book.save();
$.index.open();

,

+4

idAttribute ?

:

 exports.definition = {
    config: {
        columns: {
            "id":"integer",
            "version": "integer"
        },
        adapter: {
            type: "sql",
            collection_name: "version",
            idAttribute:'id'
        }
    },
+1

Source: https://habr.com/ru/post/1527099/


All Articles