LinkButton

Override defaults with $.fn.linkbutton.defaults.

The linkbutton is used to create a hyperlink button. It is a representation of a normal <a> tag. It can display both an icon and text, or only the icon or text. The button width can dynamic and shrink/expand to fit its text labels.

Usage Example

Create linkbutton

Create a linkbutton from markup is more easily.

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

Create a linkbutton programmatically is also allowed.

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

Process clicking on linkbutton.

Clicking on linkbutton will send the user to other page.

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

The example below will alert a message.

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

Properties

Name Type Description Default
id string The id attribute of this component. null
disabled boolean True to disable the button false
plain boolean True to show a plain effect. false
text string The button text. ''
iconCls string A CSS class to display a 16x16 icon on left. null

Methods

Name Parameter Description
options none Return options property.
disable none Disable the button.

Code example:

$('#btn').linkbutton('disable');
enable none Enable the button.

Code example:

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