i have backbone model has custom parse function, while calling fetch on model wanted skip parse function in scenarios. how can it. tried following option did not work.
mymodel.fetch({ parse: false, success: _.bind(function(model, response) {}, this), error: _.bind(function(model, response) {}, this) });
my model code:
var mymodel = basemodel.extend({ initialize: function() { console.log('eventclonemodel in initialize()'); _.extend(backbone.model.prototype, backbone.validation.mixin); }, url: function() { var url = gc.apiurl; var locale = "en_us" url += '&locale=' + locale; return url; }, parse: function(response) { //some parsing logic goes here return response; }, getvalidations: function(){ return this.validation; } }); return mymodel; });
put skip condition in parse function. how determine skip condition you.
parse: function(response) { if(skipparse) return response; //parse response here. if code reaches point, //it means want parse it. return response; },
Comments
Post a Comment