MenuButton
Class
- MenuButton ()
Attributes
- activeItem {Menu.Item} Current active menu item.
- collapsed {Boolean} Whether drop menu is shown.
- matchElWidth {} Whether drop down menu is same width with button.
- menu {Menu} Drop down menu associated with this menubutton.
- Fields borrowed from class Button: checkable, checked, collapseSide, describedby, tooltip, value
- Fields borrowed from class Component.Controller: active, activeable, children, disabled, focusable, focused, handleMouseEvents, highlighted, parent, prefixCls, view
- Fields borrowed from class Component.UIBase: created, listeners, plugins, rendered, xclass
- Fields borrowed from class Component.UIBase.Box: content, el, elAttrs, elBefore, elCls, elStyle, height, srcNode, visible, visibleMode, width
Methods
- addItem (item, index) Adds a new menu item at the end of the menu.
- bindMenu () Bind menu to current component.
- decorateChildrenInternal (UI, el) Decorate child element to from a child component.
- getItemAt (index) Returns the child menu item of drop down menu at the given index, or null if the index is out of bounds.
- handleBlur (e) Handles blur event.
- handleKeyEventInternal (e) Handle keydown/up event.
- handleMenuClick (e) Handle click on drop down menu.
- performActionInternal () Perform default action for menubutton.
- removeItem (c, destroy) Remove a existing menu item from drop down menu.
- removeItems (destroy) Remove all menu items from drop down menu.
- Methods borrowed from class Button: render
- Methods borrowed from class Component.Controller: addChild, bindUI, createDom, getChildAt, getCssClassWithPrefix, handleDblClick, handleFocus, handleKeydown, handleMouseDown, handleMouseEnter, handleMouseLeave, handleMouseUp, initializer, removeChild, removeChildren, renderUI
- Methods borrowed from class Component.UIBase: create, destroy, syncUI
- Methods borrowed from class Base: set
- Methods borrowed from class Attribute: addAttr, addAttrs, get, getAttrs, getAttrVals, hasAttr, removeAttr, reset
- Methods borrowed from class Component.UIBase.Box: hide, show
Class Detail
-
MenuButton ()A menu button component, consist of a button and a drop down popup menu. xclass: 'menubutton'.
Attributes Detail
Methods Detail
-
addItem (item, index) view sourceAdds a new menu item at the end of the menu.
- Parameters
-
- item {Menu.Item} Menu item to add to the menu.
- index
-
bindMenu () view sourceBind menu to current component. Protected, should only be overridden by subclasses.
-
decorateChildrenInternal (UI, el) view sourceDecorate child element to from a child component.
- Parameters
-
- UI {Function} Child component's constructor
- el {NodeList} Child component's root element.
-
getItemAt (index) view sourceReturns the child menu item of drop down menu at the given index, or null if the index is out of bounds.
- Parameters
-
- index {Number} 0-based index.
-
handleBlur (e) view sourceHandles blur event. When it loses keyboard focus, close the drop dow menu.
- Parameters
-
- e {Event.Object} Blur event. Protected, should only be overridden by subclasses.
-
handleKeyEventInternal (e) view sourceHandle keydown/up event. If drop down menu is visible then handle event to menu. Returns true if the event was handled, falsy otherwise. Protected, should only be overridden by subclasses.
- Parameters
-
- e {Event.Object} key event to handle.
- Returns
-
- {Boolean} True Whether the key event was handled.
-
handleMenuClick (e) view sourceHandle click on drop down menu. Fire click event on menubutton. Protected, should only be overridden by subclasses.
- Parameters
-
- e {Event.Object} Click event object.
-
performActionInternal () view sourcePerform default action for menubutton. Toggle the drop down menu to show or hide. Protected, should only be overridden by subclasses.
-
removeItem (c, destroy) view sourceRemove a existing menu item from drop down menu.
- Parameters
-
- c {Menu.Item} Existing menu item.
- [ destroy ] {Boolean} Whether destroy removed menu item.
-
removeItems (destroy) view sourceRemove all menu items from drop down menu.
- Parameters
-
- [ destroy ] {Boolean} Whether destroy removed menu items.
Classes
- Anim
- Anim.Easing
- Attribute
- Base
- Button
- ComboBox
- ComboBox.LocalDataSource
- ComboBox.RemoteDataSource
- Component
- Component.Container
- Component.Controller
- Component.Manager
- Component.Render
- Component.UIBase
- Component.UIBase.Align
- Component.UIBase.Box
- Component.UIBase.Close
- Component.UIBase.Constrain
- Component.UIBase.ContentBox
- Component.UIBase.Drag
- Component.UIBase.Loading
- Component.UIBase.Mask
- Component.UIBase.Position
- Component.UIBase.Resize
- Component.UIBase.StdMod
- Cookie
- DataLazyload
- DD
- DD.Constrain
- DD.DDM
- DD.Draggable
- DD.DraggableDelegate
- DD.Droppable
- DD.DroppableDelegate
- DD.Proxy
- DD.Scroll
- DOM
- Editor
- Editor.Range
- Editor.Utils
- Editor.Walker
- Event
- Event.Object
- Event.Target
- IO
- IO.XhrObject
- KISSY
- KISSY.Defer
- KISSY.Loader
- KISSY.Loader.Module
- KISSY.Loader.Package
- KISSY.Promise
- Menu
- Menu.FilterMenu
- Menu.Item
- Menu.PopupMenu
- Menu.Separator
- MenuButton
- MenuButton.Option
- MenuButton.Select
- MVC
- MVC.Collection
- MVC.Model
- MVC.Router
- MVC.View
- NodeList
- Overlay
- Overlay.Dialog
- Overlay.Popup
- Resizable
- Tree
- Tree.CheckNode
- Tree.CheckTree
- Tree.Node
- Waterfall
- Waterfall.Loader