You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 2, 2019. It is now read-only.
Like any OOP language, anytime you inherit a JS class and extend a method, you should call the superclass' version also unless you reimplement all the functionality's of the superclass' method. So it you do this, it should work as expected:
so regarding the logic : backbone.collection handles it by first using this.initialize.apply(this, arguments); when creating the function, and then when extending with Underscore making an empty initialize method available:
// Initialize is an empty function by default. Override it with your own// initialization logic.initialize: function(){},
so you don't have to call the superclass version. This way backbone.collection gives you full power over the initialize / constructor methods.
Whereas backbone-pageable then takes possession of that method which breaks pageable functionality if overridden.
I think it would be good then to have a point about this in the documentation as this is a ( small ) caveat which doesn't make it 100% compatible with existing code in itself if you get my meaning.
In my case I'm creating the URL through an options parameter, which I'm defining in the initialize / constructor method :
However, this removes the
.fullCollection
function ( and maybe more )Is this expected behaviour and is there a work around?
The text was updated successfully, but these errors were encountered: