define([
'underscore',
'backbone',
'models/shared_object',
'backbone_paginate'
], function(_, Backbone, Shared_Object){
"use strict";
var myCollection= Backbone.Collection.extend({
initialize: function(option) {
Backbone.Pagination.enable(this,{ipp:2,fetchOptions:{add:true}});
},
model: Shared_Object,
baseUrl: function() {
return location.protocol + '//' + location.host+'/address';
},
parse:function(dat){
return dat.items;
}
});
return new myCollection();
});
I have this collection and I am trying to paginate this in such a way that it fetches only 2 items per call. As you can see, I have ipp:2 which sets the per page to 2 items per page. Still, I don't understand why it fetches all the items of my collection. Is there something wrong with my Parse() function?