tinymce.ui.MenuButton

Inheritance
This class is used to create a UI button. A button is basically a link that is styled to look like a button or icon.

Examples

// Creates a new plugin class and a custom menu button
tinymce.create('tinymce.plugins.ExamplePlugin', {
    createControl: function(n, cm) {
        switch (n) {
            case 'mymenubutton':
                var c = cm.createSplitButton('mysplitbutton', {
                    title : 'My menu button',
                    image : 'some.gif'
                });

                c.onRenderMenu.add(function(c, m) {
                    m.add({title : 'Some title', 'class' : 'mceMenuItemTitle'}).setDisabled(1);

                    m.add({title : 'Some item 1', onclick : function() {
                        alert('Some item 1 was clicked.');
                    }});

                    m.add({title : 'Some item 2', onclick : function() {
                        alert('Some item 2 was clicked.');
                    }});
              });

              // Return the new menubutton instance
              return c;
        }

        return null;
    }
});

Events

Event Defined By
Fires when the menu is rendered.
tinymce.ui.MenuButton

Methods

Method Defined By
Constructs a new split button control instance.
tinymce.ui.MenuButton
Shows the menu.
tinymce.ui.MenuButton
Renders the menu to the DOM.
tinymce.ui.MenuButton
Hides the menu.
tinymce.ui.MenuButton
Post render handler.
tinymce.ui.MenuButton
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
Removes the control.
tinymce.ui.Control
Destroys the control will free any memory by removing event listeners etc.
tinymce.ui.Control