Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Alloy model lacking auto-generated alloy_id

$
0
0

I'm just experiencing an odd behavior relating to Alloy Models. In the model definition I did not define a config.adapter.idAttribute to let Alloy automatically generate an alloy_id. This is working fine as long as I'm fetching data from a REST API using napp.alloy.adapter.restapi as my sync adapter.

But when I try to add a new model to my collection using either collection.create( ) or like the following the new model doesn't have an alloy_id:

var evt = Alloy.createModel('event', {
    // ...
});
 
events.add(evt, { silent: true } );
 
evt.save();
Does anybody know a possible reason for this? Could this be an issue with the sync adapter? Am I doing something wrong?

Thanks for your help.


Viewing all articles
Browse latest Browse all 8068

Trending Articles