Easily render backbone.js collections with support for automatic selection of models in response to clicks, reordering models via drag and drop, and more.
npm install bb-collection-view__For demos see the Backbone.CollectionView home page.__
Depends on jQuery and jQueryUI for event handling and sorting, respectively.
* Renders a collection of models, updating automatically when models are added or removed.
* Keeps track of selected model(s) and fires events when the selection is changed.
* Adds "selected" css class to selected model views for easy stying.
* Supports single and multiple selection through meta-key and shift clicks.
* Allows a user to reorder the collection by dragging and dropping.
* Supports changing the currently selected model(s) through up and down arrow key presses.
* Allows you to filter which models are visible, selectable, and sortable.
* Integrates with Backbone.Courier out of the box.
javascript
var myCollectionView = new Backbone.CollectionView( {
el : $( "#listForCollection" ), // must be a 'ul' (i.e. unordered list) or 'table' element
modelView : EmployeeView, // a View class to be used for rendering each model in the collection
collection : employeeCollection
} );myCollectionView.render();
myCollectionView.setSelectedModel( employeeCollection.first() );
`Initialization Options
* el : A or