tinymce.ui.DropMenu

Inheritance
This class is used to create drop menus, a drop menu can be a context menu, or a menu for a list box or a menu bar.

Examples

// Adds a menu to the currently active editor instance
var dm = tinyMCE.activeEditor.controlManager.createDropMenu('somemenu');

// Add some menu items
dm.add({title : 'Menu 1', onclick : function() {
    alert('Item 1 was clicked.');
}});

dm.add({title : 'Menu 2', onclick : function() {
    alert('Item 2 was clicked.');
}});

// Adds a submenu
var sub1 = dm.addMenu({title : 'Menu 3'});
sub1.add({title : 'Menu 1.1', onclick : function() {
    alert('Item 1.1 was clicked.');
}});

// Adds a horizontal separator
sub1.addSeparator();

sub1.add({title : 'Menu 1.2', onclick : function() {
    alert('Item 1.2 was clicked.');
}});

// Adds a submenu to the submenu
var sub2 = sub1.addMenu({title : 'Menu 1.3'});

// Adds items to the sub sub menu
sub2.add({title : 'Menu 1.3.1', onclick : function() {
    alert('Item 1.3.1 was clicked.');
}});

sub2.add({title : 'Menu 1.3.2', onclick : function() {
    alert('Item 1.3.2 was clicked.');
}});

dm.add({title : 'Menu 4', onclick : function() {
    alert('Item 3 was clicked.');
}});

// Display the menu at position 100, 100
dm.showMenu(100, 100);

Methods

Method Defined By
Constructs a new drop menu control instance.
tinymce.ui.DropMenu
Created a new sub menu for the drop menu control.
tinymce.ui.DropMenu
Repaints the menu after new items have been added dynamically.
tinymce.ui.DropMenu
Displays the menu at the specified cordinate.
tinymce.ui.DropMenu
Hides the displayed menu.
tinymce.ui.DropMenu
Adds a new menu, menu item or sub classes of them to the drop menu.
tinymce.ui.DropMenu
Collapses the menu, this will hide the menu and all menu items.
tinymce.ui.DropMenu
Removes a specific sub menu or menu item from the drop menu.
tinymce.ui.DropMenu
Destroys the menu.
tinymce.ui.DropMenu
Renders the specified menu node to the dom.
tinymce.ui.DropMenu
Expands the menu, this will show them menu and all menu items.
tinymce.ui.Menu
Returns true/false if the menu has been collapsed or not.
tinymce.ui.Menu
Adds a menu separator between the menu items.
tinymce.ui.Menu
Adds a sub menu to the menu.
tinymce.ui.Menu
Returns true/false if the menu has sub menus or not.
tinymce.ui.Menu
Removes all menu items and sub menu items from the menu.
tinymce.ui.Menu
Sets the selected state for the control.
tinymce.ui.MenuItem
Returns true/false if the control is selected or not.
tinymce.ui.MenuItem
Post render handler.
tinymce.ui.MenuItem
Sets the disabled state for the control.
tinymce.ui.Control
Returns true/false if the control is disabled or not.
tinymce.ui.Control
Sets the activated state for the control.
tinymce.ui.Control
Returns true/false if the control is disabled or not.
tinymce.ui.Control
Sets the specified class state for the control.
tinymce.ui.Control
Returns true/false if the control has been rendered or not.
tinymce.ui.Control
Renders the control as a HTML string.
tinymce.ui.Control
Renders the control to the specified container element.
tinymce.ui.Control