# tinymce.ui.MenuItem

Namespace | tinymce.ui
Class | MenuItem
Inheritance | MenuItem Control
Subclasses | Menu

This class is base class for all menu item types like DropMenus items etc. This class should not be instantiated directly other menu items should inherit from this one.

## Public Methods

Method | Defined By
--- | ---
MenuItem(id:String, s:Object) Constructs a new button control instance. | MenuItem
destroy():void Destroys the control will free any memory by removing event listeners etc. | Control
isActive():Boolean Returns true/false if the control is disabled or not. | Control
isDisabled():Boolean Returns true/false if the control is disabled or not. | Control
isRendered():Boolean Returns true/false if the control has been rendered or not. | Control
isSelected():Boolean Returns true/false if the control is selected or not. | MenuItem
postRender():void Post render handler. | MenuItem
remove():void Removes the control. | Control
renderHTML():String Renders the control as a HTML string. | Control
renderTo(n:Element):void Renders the control to the specified container element. | Control
setActive(s:Boolean):void Sets the activated state for the control. | Control
setDisabled(s:Boolean):void Sets the disabled state for the control. | Control
setSelected(s:Boolean):void Sets the selected state for the control. | MenuItem
setState(c:String, s:Boolean):void Sets the specified class state for the control. | Control

## Method details

### MenuItemconstructor

`public function MenuItem(id:String, s:Object)`
Constructs a new button control instance.

#### Parameters

id:String | Button control id for the button.
s:Object | Optional name/value settings object.

### isSelectedmethod

`public function isSelected():Boolean`
Returns true/false if the control is selected or not.

#### Returns

Boolean - true/false if the control is selected or not.

### postRendermethod

`public function postRender():void`
Post render handler. This function will be called after the UI has been rendered so that events can be added.

### setSelectedmethod

`public function setSelected(s:Boolean):void`
Sets the selected state for the control. This will add CSS classes to the element that contains the control. So that it can be selected visually.

#### Parameters

s:Boolean | Boolean state if the control should be selected or not.