Clear Up
SharpKit Reference

Menu Class

A menu object. This is the container to which you may add menu items.

Menus may contain either menu items, or general Components. Menus may also contain docked items because it extends Ext.panel.Panel.

To make a contained general Component line up with other menu items, specify plain: true. This reserves a space for an icon, and indents the Component in line with the other menu items.

By default, Menus are absolutely positioned, floating Components. By configuring a Menu with floating: false, a Menu may be used as a child of a Container.

  
    Ext.create('Ext.menu.Menu', {
            width: 100,
            margin: '0 0 10 0',
            floating: false,  // usually you want this set to True (default)
            renderTo: Ext.getBody(),  // usually rendered by it's containing component
            items: [{
            text: 'regular item 1'
            },{
            text: 'regular item 2'
            },{
            text: 'regular item 3'
            }]
            });
            Ext.create('Ext.menu.Menu', {
            width: 100,
            plain: true,
            floating: false,  // usually you want this set to True (default)
            renderTo: Ext.getBody(),  // usually rendered by it's containing component
            items: [{
            text: 'plain item 1'
            },{
            text: 'plain item 2'
            },{
            text: 'plain item 3'
            }]
            });
            

Namespace: Ext.menu

Constructors

Fields

Name Description
allowOtherMenus True to allow multiple menus to be displayed at the same time. Defaults to: false
ariaRole Defaults to: "menu"
constrain Menus are constrained to the document body by default. Defaults to: true
defaultAlign The default Ext.Element#getAlignToXY anchor position value for this menu relative to its element of origin. Defaults to: "tl-bl?"
enableKeyNav True to enable keyboard navigation for controlling the menu. This option should generally be disabled when form fields are being used inside the menu. Defaults to: true
ignoreParentClicks True to ignore clicks on any item in this menu that is a parent item (displays a submenu) so that the submenu is not dismissed when clicking the parent item. Defaults to: false
plain True to remove the incised line down the left side of the menu and to not indent general Component items. Defaults to: false
showSeparator True to show the icon separator. Defaults to: true

Methods

Name Description
canActivateItem(object) Returns whether a menu item can be activated or not.
deactivateActiveItem(object) Deactivates the current active item on the menu, if one exists.
showBy(object, object, object) Shows the floating menu by the specified Component or Element.

Properties

Name Description
isMenu true in this class to identify an object as an instantiated Menu, or subclass thereof. Defaults to: true
parentMenu The parent Menu of this Menu.
© Copyright 2005-2011 SharpKit. All rights reserved.