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

Field Detail

autoHideMaster Boolean

Whether 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
classNames Array
Default value:
['sc-master-detail-view']
See:
SC.View#classNames
detailView SC.View

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
dividerWidth Number
The width of the divider between the master and detail views.
Default value:
From theme, or 1.
masterIsHidden Boolean
A property (computed) that says whether the master view is hidden.
Default value:
NO
masterView SC.View

The master view. For your development pleasure, it defaults to a WorkspaceView with a top toolbar.

Default value:
SC.WorkspaceView
masterWidth Number
The width of the 'master' side of the master/detail view.
Default value:
250
orientation String

Tracks the orientation of the view. Possible values:

  • SC.VERTICAL_ORIENTATION
  • SC.HORIZONTAL_ORIENTATION
Default value:
SC.VERTICAL_ORIENTATION
pickerPane SC.PickerPane

The picker pane class from which to create a picker pane.

This defaults to one with a special theme.

Default value:
SC.PickerPane
renderDelegateName String
Default value:
'masterDetailRenderDelegate'

Instance Method Detail

hideMasterPicker()
hidePicker(picker)
Parameters:
picker SC.PickerPane
The picker to popup
showMasterPicker(view)
Parameters:
view SC.View
The view to anchor the picker to
showPicker(picker, view)
Parameters:
picker SC.PickerPane
The picker to popup
view SC.View
The view to anchor the picker to
toggleMasterPicker(view)

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
Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 08 2015 10:02:20 GMT-0600 (CST)