javascript - Enyo different collection with same model kind -
I am trying to create two collections with a normal model type. I get the following error:
"Unkuit Ino Store .ADrcord: Duplicate record set with the primary id
67774271 which set
unseen duplicate to
true >
The following are two collections I have defined ...
enyo.kind ({name: "app.FeatureCollection" , Kind: "enyo.collection", Model: "app ImageModel", defaultSource: "appF", ... ...}); enyo.kind ({name: "app.SearchCollection", kind: "enyo.collection", model: "app.imagemodel" , defaultSource: "apps", ... ...}); And the model I am using is as follows:
enyo.kind ({name: "app.imagemodel", kind: "enyo model", read only: truth, .... ....}); One At the point I am setting this way:
this.set ("Data", new app. Fetcher Collection ()); And in the second,
this.set ("Data", New App. Search Collection ()); I can not know what could be causing the error. I also tried to "correctly ignore the duplicate" in the model ... but still get the error. Any suggestions where I might be wrong.
Ignore duplicate flag is expected enyo.store < not set to / code> and enyo.model :
enyo.store.ignoreDuplicates = true; Are you using fetch method of enyo.collection to recover your data? If so, you might consider setting the strategy property to merge in your phone call so that you have a record for each unique image from your dataset, i.e. :
myCollection.fetch ({strategy: "merge", success: function (rec, opts, race) {// do something after receiving data}});
Comments
Post a Comment