tinymce.ui.SplitButton

Inheritance
Subclasses ColorSplitButton
This class is used to create a split button. A button with a menu attached to it.

Examples

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

                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 splitbutton instance
              return c;
        }

        return null;
    }
});

Methods

Method Defined By
Constructs a new split button control instance.
tinymce.ui.SplitButton
Renders the split button as a HTML string.
tinymce.ui.SplitButton
Post render handler.
tinymce.ui.SplitButton
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 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