Extend from $.fn.linkbutton.defaults. Override defaults with $.fn.menubutton.defaults.
The menubutton is the part of drop-down menu. It is associated with a linkbutton and menu. The linkbutton is displayed while the menu is hidden. When users click or move the mouse over the linkbutton, the menu will show to allow to click on it.
Usually the menubutton is created declaratively from markup.
- <a href="javascript:void(0)" id="mb" class="easyui-menubutton"
- data-options="menu:'#mm',iconCls:'icon-edit'">Edit</a>
- <div id="mm" style="width:150px;">
- <div data-options="iconCls:'icon-undo'">Undo</div>
- <div data-options="iconCls:'icon-redo'">Redo</div>
- <div class="menu-sep"></div>
- <div>Cut</div>
- <div>Copy</div>
- <div>Paste</div>
- <div class="menu-sep"></div>
- <div data-options="iconCls:'icon-remove'">Delete</div>
- <div>Select All</div>
- </div>
Create menubutton using javascript.
- <a href="javascript:void(0)" id="mb">Edit</a>
- <div id="mm" style="width:150px">
- ...
- </div>
- $('#mb').menubutton({
- iconCls: 'icon-edit',
- menu: '#mm'
- });
The properties extend from linkbutton, below is the added properties for menubutton.
Name | Type | Description | Default |
---|---|---|---|
plain | boolean | True to show plain effect. | true |
menu | string | A selector to create a corresponding menu. | null |
duration | number | Defines duration time in milliseconds to show menu when hovering the button. | 100 |
The methods extend from linkbutton, below is the added or overridden methods for splitbutton.
Name | Parameter | Description |
---|---|---|
options | none | Return the options object. |
disable | none | Disable the menubutton. |
enable | none | Enable the menubutton. |
destroy | none | Destroy the menubutton. |