Class: SC.TreeController
Extends
SC.ObjectController, SC.SelectionSupport.
A TreeController manages a tree of model objects that you might want to
display in the UI using a collection view. For the most part, you should
work with a TreeController much like you would an ObjectController, except
that the TreeController will also provide an arrangedObjects
property that
can be used as the content of a CollectionView.
Defined in: tree.js
- Since:
- SproutCore 1.0
Field Summary
- Fields borrowed from SC.ObjectController:
- allowsMultipleContent, content, isEditable
- Fields borrowed from SC.Controller:
- destroyContentOnReplace
- Fields borrowed from SC.Object:
- concatenatedProperties, isDestroyed, isObject, nextProperty, object, property, target, toInvalidate
- Fields borrowed from SC.Observable:
- isObservable
Field Detail
arrangedObjects SC.ArrayReturns an SC.Array
object that actually will represent the tree as a
flat array suitable for use by a CollectionView. Other than binding this
property as the content of a CollectionView, you generally should not
use this property directly. Instead, work on the tree content using the
TreeController like you would any other ObjectController.
Set to the name of the property on your content object that holds the children array for each tree node. The default is "treeItemChildren".
- Default value:
- "treeItemChildren"
If your content support expanding and collapsing of content, then set this property to the name of the key on your model that should be used to determine the expansion state of the item. The default is "treeItemIsExpanded"
- Default value:
- "treeItemIsExpanded"
Set to YES
if you want the top-level items in the tree to be displayed as
group items in the collection view.
- Default value:
- NO