So I have got this new project which has this line in every view.
Backbone.Layout.extend({ /*...*/ })
But when I look at the documentation for Backbone and other tutorials, it has
Backbone.View.extend({ /*...*/ })
Also all the views have initialize, serialize, afterRender functions. I tried searching it, but has not found anything useful.
Your project is using backbone.layoutmanager
Looking in the source of this library, we can see that it's just a specialized
Backbone.View.It adds these methods and properties:
afterRendercleanupgetViewgetViewsinsertViewinsertViewsremoveViewrenderViewssetViewsetViewsthenuseRAFserialize(not documented in the wiki)The
initializefunction is a default in a Backbone view, it is empty and it's meant to be overriden with custom initialization code.To get a better understanding of what's going on in a project, look at the dependencies it loads (the
.jsfiles included with<script>tags in the HTML).