I want to override the sampling method in models, as well as in collections, to retrieve data from localstorage when there is no network connection.
This is a selection function within the collection.
fetch:function(){ if(online){ return Backbone.Collection.prototype.fetch.call(this) ; }else{
I ran into two problems here
a. Success or error function not executed
this.collection.fetch({ success: function(data){ ... }, error: function(){ ... } });
b. If there is no connection, how to set data to a collection so that I can access it in the success function
Anenth
source share