0.3.1 • Published 7 years ago

selectable-collection v0.3.1

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

SelectableCollection

A lightweight mixin for Backbone.js collections that provides single and multi model selection

This collection instance mixin provides the ability to mark models as selected and active.

There is one active model at a time and may be many selected. The collection will trigger an "activeModelChanged" event when the active model is set via setActiveModel() method. Current version of this component does not support having active model that is not selected. Calling setActiveModel on an unselected model, selects it.

example:

  kittensCollection = new Backbone.Collection()
  SelectableCollection.applyTo(kittensCollection)
  kittensCollection.onSelectionsChanged(function(){
    alert("you selected " + kittensCollection.getSelectedModels().length + " kittens")
  })
  ...

  kittensCollection.selectModelByIndex(0)
  ...

See our api docs for more information on the events and methods added to the collection.

0.3.1

7 years ago

0.3.0

7 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago