Class: SC.MasterDetailView
Master/Detail view is a simple view which manages a master view and a detail view. This is not all that different from a SplitView, except that, for the moment (this will hopefully change when SplitView becomes more palatable) the split point is not actually changeable and the split is always vertical.
So, why use it when it is limited? Well, simple: it can hide the left side. Completely. As in, there will be no split divider anymore. There will be no nothing. It will be gone. Removed from DOM. Gone on to meet its maker, bereft of life, it rests in peace. If it weren't for the possibility of opening it up in a picker it would be pushing up the daisies!
Yes, it has a built-in option for opening the master portion in a PickerPane. This is THE KILLER
FEATURES. It is a command on the view: popupMasterPicker
. And it is really really easy to call:
make a toolbar button with an action "popupMasterPicker". That's it.
An interesting feature is that it sets the master and detail views' masterIsVisible
settings,
allowing them to know if the master is visible.
Defined in: master_detail.js
- Since:
- SproutCore 1.2
Field Summary
Instance Methods
- hideMasterPicker()
- hidePicker(picker)
- showMasterPicker(view)
- showPicker(picker, view)
- toggleMasterPicker(view)
Field Detail
autoHideMaster BooleanWhether to automatically hide the master panel in portrait orientation.
By default, this property is a computed property based on whether the browser is a touch
browser. Your purpose in overriding it is either to disable it from automatically
disappearing on iPad
and other touch devices, or force it to appear when a desktop
browser changes.
- Default value:
- NO
- Default value:
- ['sc-master-detail-view']
- See:
- SC.View#classNames
The detail view. For your development experience, it defaults to holding a top toolbar view with a button that closes/shows master. Come take a peek at the code to see what it looks like--it is so simple.
- Default value:
- SC.WorkspaceView
- Default value:
- From theme, or 1.
- Default value:
- NO
The master view. For your development pleasure, it defaults to a WorkspaceView with a top toolbar.
- Default value:
- SC.WorkspaceView
- Default value:
- 250
Tracks the orientation of the view. Possible values:
SC.VERTICAL_ORIENTATION
SC.HORIZONTAL_ORIENTATION
- Default value:
- SC.VERTICAL_ORIENTATION
The picker pane class from which to create a picker pane.
This defaults to one with a special theme.
- Default value:
- SC.PickerPane
- Default value:
- 'masterDetailRenderDelegate'
Instance Method Detail
- Parameters:
- picker SC.PickerPane
- The picker to popup
- Parameters:
- view SC.View
- The view to anchor the picker to
- Parameters:
- picker SC.PickerPane
- The picker to popup
- view SC.View
- The view to anchor the picker to
If the master is hidden, this toggles the master picker pane. Of course, since pickers are modal, this actually only needs to handle showing.
- Parameters:
- view SC.View
- The view to anchor the picker to