jQuery EasyUI menu and button widget - Splitbutton split button
Extended from $ .fn.linkbutton.defaults. By $ .fn.splitbutton.defaults override the default defaults.
And the menu button (menubutton) similar, the link button (linkbutton) and menu (menu) on thumbnail button (splitbutton). And the menu button (menubutton) is different, split button (splitbutton) is divided into two parts. When moving the mouse to the split button (splitbutton) on, it will display a dividing line. Only when you move the mouse when the right part of the split button to display the menu (menu).
rely
- menubutton
usage
Create split button from the tag (splitbutton).
<A href = "javascript: void (0)" id = "sb" class = "easyui-splitbutton" data-options = "menu: '# mm', iconCls: 'icon-ok'" onclick = "javascript: alert ( 'ok')"> Ok </a> <Div id = "mm" style = "width: 100px;"> <Div data-options = "iconCls: 'icon-ok'"> Ok </ div> <Div data-options = "iconCls: 'icon-cancel'"> Cancel </ div> </ Div>
Use javascript to create split button (splitbutton).
<a href="javascript:void(0)" id="sb" onclick="javascript:alert('ok')"> Ok </a> <Div id = "mm" style = "width: 100px;"> ... </ Div>
$ ( '# Sb'). Splitbutton ({ iconCls: 'icon-ok', menu: '#mm' });
Attributes
The property extends from the link button (linkbutton), the following is the split button (splitbutton) increased properties.
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
plain | boolean | 如果设置为 true,则显示一个简单的效果。 | true |
menu | string | 用于创建对应菜单(menu)的选择器。 | null |
duration | number | 当悬停在按钮上时,以毫秒为单位定义的,显示菜单(menu)的持续时间。 | 100 |
method
The method inherited from the link button (linkbutton), the following is the split button (splitbutton) increased or overridden methods.
名称 | 参数 | 描述 |
---|---|---|
options | none | 返回选项(options)对象。 |
disable | none | 禁用分割按钮(splitbutton)。代码实例:
$('#sb').splitbutton('disable'); |
enable | none | 启用分割按钮(splitbutton)。代码实例:
$('#sb').splitbutton('enable'); |
destroy | none | 销毁分割按钮(splitbutton)。 |
jQuery EasyUI plugin