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

merging backbone model attributes

$
0
0

hi, I am have a custom REST web-service adapter implemented using backbone & alloy. When I call collection.fetch(merge: true, add: true), the REST service returns user data which could be new models or existing models with updated data (model ID already in the collection).

If the model already exists in the collection, I would like to be able to merge updated attributes to the existing models. I have noticed that with backbone 0.9.2 the 'merge' functionality does not seem to be implemented. However backbone 1.0.0 seems to have implemented the 'merge' functionality. Is it possible to use backbone.js 1.0.0 with Titanium alloy v3.1.1 or the latest alloy tip from github?

Alternatively is there an option to extend the collection.fetch() method to do custom merge of the updated attributes?

Appreciate your inputs. Thanks.


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>