Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2014
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     App.buildModelCollection = function(modelName) {
  2.         var model = new App.Models[modelName]();                                                                                                                                        
  3.         var url = model.urlRoot;
  4.         var collection = Backbone.Collection.extend({
  5.             model: App.Models[modelName],
  6.             url: url,
  7.             retrieve: function() {
  8.                 this.fetch({
  9.                     data: {
  10.                         filter: App.Options.Filter
  11.                     },  
  12.                     success: function(collection) {
  13.                         console.log(collection);
  14.                     }  
  15.                 });
  16.             }  
  17.         });
  18.         return new collection();
  19.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement