javascript - Sencha Touch Store Add replaces record 1 -
i extended ext.data.store (i.e users model user) when iterate on custom json response , add each record, replaces first record , store consist of 1 record instead of many
here code (in image format) notice in line 215 added model on store on each iteration:
and here console output w/c shows 1 on getcount():
i tried many solutions, , includes changing 'id' attribute else , differ user model users model
but have store adding fine without problems.
edit: tried adding through javascript console , still replaces record 1:
the store's add
function automatically handle creation of model(s). callback should simple this:
callback: function(optionsusers, successusers, responseusers) { loadingloginmodal.hide(); var responseusersjson = ext.json.decode(responseusers.responsetext); userstore.add(responseusersjson); loadingloginmodal.destroy(); that.showhomeview(); }
Comments
Post a Comment