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
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.