Provides a logical structure for assembling layouts with Backbone Views. Designed to be adaptive and configurable for painless integration.
Depends on Underscore, Backbone and jQuery. You can swap out the dependencies completely with a custom configuration.
There are two distinct constructors within LayoutManager:
Layout
and LayoutView
. These have
various aliases and share many methods, but they differ in
two key places.
manage
Booleantrue
in order to gain the
benefits of LayoutManager.template
Any datatyperender
method.data
Object/Functionrender
method.setView([selector], view, [append])
setViews(views)
getView([filterFn])
getViews
filter function.getViews([filterFn])
insertView([selector], view)
insertViews(views)
setViews
.render()
remove
Customize these options to
paths
Objecttemplate
and layout
. Must end with a trailing /
.deferred()
Returns Promise/A deferred.fetch(template)
Returns template function.partial(parent, selector, child, [append])
Returns Undefined.html(parent, child)
append(parent, child)
when(promises)
render(template, data)
contains(parent, child)