Implements common selection management properties for controllers.
Selection can be managed by any controller in your applications. This mixin provides some common management features you might want such as disabling selection, or restricting empty or multiple selections.
To use this mixin, simply add it to any controller you want to manage
selection and call
whenever your source content changes. You can also override the properties
defined below to configure how the selection management will treat your
This mixin assumes the
arrangedObjects property will return an
content you want the selection to reflect.
Add this mixin to any controller you want to manage selection. It is
already applied to
Defined in: selection_support.js
- SproutCore 1.0
- selection(key, value)
- selectObject(object, extend)
- selectObjects(objects, extend)
Field DetailSC.SelectionSupport.allowsEmptySelection Boolean
Class Method Detail
Override to return the first selectable object. For example, if you have groups or want to otherwise limit the kinds of objects that can be selected.
the default implementation returns
- first selectable object
This is the current selection. You can make this selection and another controller's selection work in concert by binding them together. You generally have a master selection that relays changes TO all the others.
Selects a single passed object in your content. If you set "extend" to
YES then this will attempt to extend your selection as well.
Selects the passed objects in your content. If you set "extend" to
then this will attempt to extend your selection as well.
Call this method whenever your source content changes to ensure the selection always remains up-to-date and valid.