jQuery EasyUI 菜单与按钮插件 - Menubutton 菜单按钮

jQuery EasyUI 教程 · 2019-04-07 15:19:33

扩展自 $.fn.linkbutton.defaults。通过 $.fn.menubutton.defaults 重写默认的 defaults。

码单按钮(menubutton)是下拉码单的一部分。它与链接按钮(linkbutton)及码单(menu)有关。显示链接按钮(linkbutton),隐藏码单(menu)。当用户点击或移动鼠标到链接按钮(linkbutton)上时,将显示码单(menu)以允许用户点击码单。

依赖

  • menu
  • linkbutton

用法

通常,码单按钮(menubutton)以声明的方式从标记创建。

<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>

使用 javascript 创建码单按钮(menubutton)。

<a href="javascript:void(0)" id="mb">Edit</a>
<div id="mm" style="width:150px">
...
</div>
$('#mb').menubutton({
    iconCls: 'icon-edit',
    menu: '#mm'
});

属性

该属性扩展自链接按钮(linkbutton),下面是码单按钮(menubutton)增加的属性。

名称 类型 描述 默认值
plain boolean 如果设置为 true,则显示一个简单的效果。 true
menu string 用于创建对应码单(menu)的选择器。 null
duration number 当悬停在按钮上时,以毫秒为单位定义的,显示码单(menu)的持续时间。 100

方法

该方法继承自链接按钮(linkbutton),下面是码单按钮(menubutton)增加的或重写的方法。

名称 参数 描述
options none 返回选项(options)对象。
disable none 禁用码单按钮(menubutton)。
enable none 启用码单按钮(menubutton)。
destroy none 销毁码单按钮(menubutton)。

点击查看所有 jQuery EasyUI 教程 文章: https://www.codercto.com/courses/l/42.html

查看所有标签

Web Security Testing Cookbook

Web Security Testing Cookbook

Paco Hope、Ben Walther / O'Reilly Media / 2008-10-24 / USD 39.99

Among the tests you perform on web applications, security testing is perhaps the most important, yet it's often the most neglected. The recipes in the Web Security Testing Cookbook demonstrate how dev......一起来看看 《Web Security Testing Cookbook》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具