使用$.fn.linkbutton.defaults重写默认值对象。

按钮组件使用超链接按钮创建。它使用一个普通的<a>标签进行展示。它可以同时显示一个图标和文本,或只有图标或文字。按钮的宽度可以动态和折叠/展开以适应它的文本标签。

使用案例

创建按钮

使用标签创建按钮更加简单。

  1. <a id="btn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'">easyui</a>
<a id="btn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'">easyui</a>

也可以使用Javascript创建按钮。

  1. <a id="btn" href="#">easyui</a>
  2. $('#btn').linkbutton({
  3. iconCls: 'icon-search'
  4. });
<a id="btn" href="#">easyui</a>
$('#btn').linkbutton({
iconCls: 'icon-search'
});
处理按钮的点击

点击按钮会将用户引导到其他页面。

  1. <a href="otherpage.php" class="easyui-linkbutton" data-options="iconCls:'icon-search'">easyui</a>
<a href="otherpage.php" class="easyui-linkbutton" data-options="iconCls:'icon-search'">easyui</a>

下面的示例提示了一个警告信息。

  1. <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'"
  2. onclick="javascript:alert('easyui')">easyui</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'"
onclick="javascript:alert('easyui')">easyui</a>

Bind click handler using jQuery.

  1. <a id="btn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'">easyui</a>
<a id="btn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'">easyui</a>
  1. $(function(){
  2. $('#btn').bind('click', function(){
  3. alert('easyui');
  4. });
  5. });
$(function(){
$('#btn').bind('click', function(){
alert('easyui');
});
});

属性

属性名 属性值类型 描述 默认值
id string 组件的ID属性。 null
disabled boolean 为true时禁用按钮。 false
plain boolean 为true时显示简洁效果。 false
text string 按钮文字。 ''
iconCls string 显示在按钮文字左侧的图标(16x16)的CSS类ID。 null
iconAlign string 按钮图标位置。可用值有:'left','right'。(该属性自1.3.2版开始可用) left

方法

方法名 方法参数 描述
options none 返回属性对象。
disable none 禁用按钮。

代码示例:

$('#btn').linkbutton('disable');
enable none 启用按钮。

代码示例:

$('#btn').linkbutton('enable');

LinkButton(按钮)的更多相关文章

  1. 第一百九十七节,jQuery EasyUI,LinkButton(按钮)组件

    jQuery EasyUI,LinkButton(按钮)组件 学习要点: 1.加载方式 2.属性列表 3.方法列表 本节课重点了解 EasyUI 中 LinkButton(按钮)组件的使用方法,这个组 ...

  2. jQuery EasyUI,LinkButton(按钮)组件

    转自:https://www.cnblogs.com/adc8868/p/6639570.html jQuery EasyUI,LinkButton(按钮)组件 学习要点: 1.加载方式 2.属性列表 ...

  3. ASP.NET中获取Repeater模板列中LinkButton按钮事件中获取ID等

    前台页面中: <asp:Repeater ID="repComment" runat="server">            <ItemTe ...

  4. 关于后台管理linkbutton按钮几个重要属性的理解

    <asp:LinkButton ID="lkbtnDelete" runat="server" CausesValidation="False& ...

  5. LinkButton( 按钮)

    一. 加载方式 //class 加载方式<a href="###" class="easyui-linkbutton">按钮</a> / ...

  6. EasyUI系列学习(七)-Linkbutton(按钮)

    一.加载组件 1.使用class加载 <a href="#" class="easyui-linkbutton">按钮</a> 2.使用 ...

  7. LinkButton(按钮)组件

    一.//class加载方式 <div id="pos" class="easyui-linkbutton">按钮</div> 二.js加 ...

  8. EasyUI - LinkButton 按钮控件

    效果: html代码: <div> <a href ="abc.html" id="btn">添加</a> </div ...

  9. easyui按钮linkbutton 不可用(置灰)与 可用(取消置灰)

    easyui linkbutton按钮: 不可用(置灰) $('#butFree').linkbutton('disable'); 可用(取消置灰) $('#butFree').linkbutton( ...

  10. WPF DataGrid 操作列 类似 LinkButton

    WPF中没有类似LinkButton,所以只有运用Button及样式来实现LinkButton. DataGrid 操作列 实现 多个类似LinkButton按钮: 具体实现代码如下: <Dat ...

随机推荐

  1. QTP鼠标点击和浏览器事件的动态切换

    今天在群里有人问到一个问题,我觉得应该会有很多人会碰到,今天根据自己的思路把这个解决方案整理出来,供自己和大家参考 需求描述: 当输入一个身份证号码的时候,这个号码所对应的数据会被加载到所属的省和市的 ...

  2. 配置centos 7 mysql

    http://www.cnblogs.com/starof/p/4680083.html 一.系统环境 yum update升级以后的系统版本为 [root@yl-web yl]# cat /etc/ ...

  3. Objective-C命名编写规范

    There are only two hard things in Computer Science: cache invalidation and naming things. 在计算机科学中只有两 ...

  4. [HDOJ4612]Warm up(双连通分量,缩点,树直径)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4612 所有图论题都要往树上考虑 题意:给一张图,仅允许添加一条边,问能干掉的最多条桥有多少. 必须解决 ...

  5. bzoj1566

    好题,这道题体现了换一个角度计数的思想 a1^2+a2^2+……ak^2=(变成第1种输出序列的操作序列数目)^2+(变成第2种输出序列的操作序列数目)^2…… 脑洞大一点,这就相当于两个操作序列变成 ...

  6. CentOS 5.6 netInstall可以的在线安装方式。

    之前百度google了一把, 发现原来的地址都失效了. 只找到一个能用的. 下载9M多的CentOS Net Install ISO文件,  选择安装方式时选HTTP. 然后在后面的 服务器位置处输入 ...

  7. Java [leetcode 7] Reverse Integer

    问题描述: Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 Ha ...

  8. c & c++中const

    1 const的基本用法 常变量:  const 类型说明符 变量名 #在c语言中,仍是一个变量.c++中则变为一个常量,比如可以设置为数组的长度 常引用:  const 类型说明符 &引用名 ...

  9. shell 删除日志

    一般线上服务的日志都是采用回滚的防止,写一定数量的日志 或是有管理工具定期去转移老旧日志 前几天删除一个测试环境的日志,只保留两天的日志,结果把正在写的日志都给删掉了,不得不重启了服务,经过这一次的错 ...

  10. 对Spring IoC容器实现的结构分析

    本文的目标:从实现的角度来认识SpringIoC容器. 观察的角度:从外部接口,内部实现,组成部分,执行过程四个方面来认识SpringIoC容器. 本文的风格:首先列出SpringIoC的外部接口及内 ...