Home

# Class goog.ui.SelectionMenuButton

A selection menu button control. Extends {@link goog.ui.MenuButton}. Menu contains 'select all' and 'select none' MenuItems for selecting all and no items by default. Other MenuItems can be added by user. The checkbox content fires the action events associated with the 'select all' and 'select none' menu items.

extends goog.ui.MenuButton

Instance Method Summary
| `addCheckboxEvent()` Set up events related to the checkbox.
| `addMenuEvent_()` Set up events related to the menu items.
| `createCheckbox()` Creates and adds the checkbox to the button.
| `createDom()` Adds the checkbox to the button, and adds 2 items to the menu corresponding to 'select all' and 'select none'.
| `decorateInternal(?Element element)` Decorates the given element with this component. Overrides {@link goog.ui.Component#decorateInternal} by delegating DOM manipulation to the control's renderer.
| `getCheckboxElement() ⇒ ?Element` Gets the checkbox element. Needed because if decorating html, getContent() may include and comment/text elements in addition to the input element.
| `getSelectionState() ⇒ ?goog.ui.SelectionMenuButton.SelectionState` Get selection state.
| `handleCheckboxClick(?goog.events.BrowserEvent e)` Checkbox click handler.
| `handleMenuAction_(?goog.events.Event e)` Menu action handler to update checkbox checked state.
| `handleMouseDown(?goog.events.Event e)` Handles mousedown events. Invokes the superclass implementation to dispatch an ACTIVATE event and activate the button. Also toggles the visibility of the attached menu.
| `setCheckboxEnabled(boolean enable)` Enables the embedded checkbox.
| `setEnabled(boolean enable)` Enables button and embedded checkbox.
| `setMenu(?goog.ui.Menu menu) ⇒ (goog.ui.Menu|null|undefined)` Replaces the menu attached to the button with the argument, and returns the previous menu (if any).
| `setSelectionState(?goog.ui.SelectionMenuButton.SelectionState state)` Set selection state and update checkbox.