Class: SC.PopupButtonView
Extends
SC.ButtonView.
SC.PopupButtonView
displays a pop-up menu when clicked, from which the user
can select an item.
To use, create the SC.PopupButtonView
as you would a standard SC.ButtonView
,
then set the menu property to an instance of SC.MenuPane.
For example:
SC.PopupButtonView.design({
layout: { width: 200, height: 18 },
menuBinding: 'MyApp.menuController.menuPane'
});
You would then have your MyApp.menuController
return an instance of the menu
to display.
Defined in: popup_button.js
Field Summary
- Fields borrowed from SC.ButtonView:
- action, ariaRole, autoResizePadding, buttonBehavior, contentIconKey, contentTitleKey, displayProperties, escapeHTML, icon, isCancel, isDefault, keyEquivalent, localize, needsEllipsis, supportFocusRing, target, themeName, title, toggleOffValue, toggleOnValue, value
- Fields borrowed from SC.View:
- acceptsMultitouch, ariaHidden, attributeBindings, autoMixins, backgroundColor, childViewLayout, childViewLayoutOptions, childViews, childViewsNeedLayout, classNameBindings, concatenatedProperties, createdByParent, designMode, enabledState, firstKeyView, hasLayout, hasTouch, hasVisibility, isBuildingIn, isBuildingOut, isChildViewLayoutLive, isEnabled, isFixedHeight, isFixedPosition, isFixedSize, isFixedWidth, isKeyResponder, isTextSelectable, isView, isVisible, lastKeyView, layerLocationNeedsUpdate, layerNeedsUpdate, layout, modeAdjust, nextKeyView, page, pane, parentView, previousKeyView, shouldInheritCursor, shouldInheritEnabled, tagName, toolTip, touchBoundary, transitionAdjust, transitionAdjustOptions, transitionHide, transitionHideOptions, transitionIn, transitionInOptions, transitionOut, transitionOutOptions, transitionShow, transitionShowOptions, useStaticLayout
- Fields borrowed from SC.Responder:
- hasFirstResponder, isFirstResponder, responderContext
- Fields borrowed from SC.Object:
- isDestroyed, isObject, nextProperty, object, property, toInvalidate
- Fields borrowed from SC.Observable:
- isObservable
- Fields borrowed from SC.Control:
- controlSize, errorLabel, fieldKey, fieldLabel, isActive, isControl, isSelected
Instance Methods
- Methods borrowed from SC.ButtonView:
- acceptsFirstResponder, computeIsSelectedForValue, didTriggerAction, displayTitle, performKeyEquivalent, triggerActionAfterDelay
- Methods borrowed from SC.View:
- $, adjust, animate, appendChild, applyAttributesToContext, beginLiveResize, borderFrame, buildIn, buildInChild, buildInDidCancel, buildInDidFinish, buildInDidFinishFor, buildOut, buildOutChild, buildOutDidCancel, buildOutDidFinish, cancelAnimation, clippingFrame, computeFrameWithParentFrame, computeParentDimensions, containerLayer, contextMenu, convertFrameFromView, convertFrameToView, createChildView, createChildViews, createLayer, cursor, destroy, destroyLayer, didBecomeKeyResponderFrom, didLoseKeyResponderTo, displayDidChange, displayToolTip, emitDesign, encodeDesign, endLiveResize, findLayerInParentLayer, frame, init, insertBefore, insertText, interpretKeyEvents, invokeRenderDelegateMethod, isContextMenuEnabled, isDescendantOf, isEnabledInPane, isFixedLayout, layer, layerId, layerIdDidChange, layoutChildViews, layoutChildViewsIfNeeded, layoutDidChange, layoutDidChangeFor, layoutStyle, layoutView, nextResponder, nextValidKeyView, owner, parentViewDidChange, parentViewDidResize, previousValidKeyView, propertyDidChange, recomputeIsVisibleInWindow, removeAllChildren, removeChild, removeChildAndDestroy, removeFromParent, render, renderChildViews, renderContext, renderDelegate, renderDelegateProxy, renderLayout, replaceAllChildren, replaceChild, replaceLayer, resetAnimation, resetBuild, resetBuildState, respondsTo, scrollToVisible, selectStart, theme, touchIsInBoundary, tryToPerform, updateDesignMode, updateLayer, updateLayerIfNeeded, updateLayerLocation, updateLayerLocationIfNeeded, updateLayout, viewDidResize, willBecomeKeyResponderFrom, willLoseKeyResponderTo
- Methods borrowed from SC.Responder:
- becomeFirstResponder, didBecomeFirstResponder, resignFirstResponder, willLoseFirstResponder
- Methods borrowed from SC.Object:
- activate, awake, deactivate, instanceOf, invokeLast, invokeLater, invokeNext, invokeOnce, invokeOnceLater, invokeWith, kindOf, mixin, notifyPropertyDidChange, superclass, toString
- Methods borrowed from SC.Observable:
- addObserver, addObservesHandler, addProbe, allPropertiesDidChange, automaticallyNotifiesObserversFor, beginPropertyChanges, bind, decrementProperty, destroyObservable, didChangeFor, endPropertyChanges, get, getEach, getPath, hasObserverFor, incrementProperty, initObservable, logProperty, notifyPropertyChange, observersForKey, propertyWillChange, registerDependentKey, removeObserver, removeObservesHandler, removeProbe, set, setIfChanged, setPath, setPathIfChanged, toggleProperty, unknownProperty
Field Detail
classNames Array- Default value:
- ['sc-popup-button']
- See:
- SC.View#classNames
- Default value:
- null
Defined in: popup_button.js.
- Default value:
- [0, 0, 0]
- Default value:
- 'popupButtonRenderDelegate'
If YES
and the menu is a class, this will cause a task that will instantiate the menu
to be added to SC.backgroundTaskQueue.
- Default value:
- NO
Instance Method Detail
Called to instantiate a menu. You can override this to set properties such as the menu's width or the currently selected item.
Defined in: popup_button.js.
- Parameters:
- menu SC.MenuPane
- The MenuPane class to instantiate.
Defined in: popup_button.js.
Instantiates the menu if it exists and is not already instantiated. If another menu is already instantiated, it will be destroyed.
Defined in: popup_button.js.
Shows the PopupButton's menu. You can call this to show it manually.
NOTE: The menu will not be shown until the end of the Run Loop.
Defined in: popup_button.js.