jQuery EasyUI Menu and Button Plugin - Linkbutton Link Button
Override defaults with $.fn.linkbutton.defaults.
The linkbutton is used to create a hyperlink button. It represents a normal <a> tag. It can display an icon and text, or just one of them. The button width can dynamically shrink/expand to fit the text label.
Usage
Create Linkbutton
Creating a linkbutton from markup is easier.
<a id="btn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'">easyui</a>
Programmatically creating a linkbutton is also allowed.
<a id="btn" href="#">easyui</a>
$('#btn').linkbutton({
iconCls: 'icon-search'
});
Handle Click on Linkbutton
Clicking on the linkbutton will direct the user to another page.
<a href="otherpage.php" class="easyui-linkbutton" data-options="iconCls:'icon-search'">easyui</a>
The following example will alert a message.
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'"
onclick="javascript:alert('easyui')">easyui</a>
Bind click handler using jQuery.
<a id="btn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'">easyui</a>
$(function(){
$('#btn').bind('click', function(){
alert('easyui');
});
});
Properties
| Name | Type | Description | Default |
|---|---|---|---|
| id | string | The id attribute of the component. | null |
| disabled | boolean | If set to true, disable the button. | false |
| toggle | boolean | If set to true, allow the user to toggle the button's selected state. This property is available since version 1.3.3. | false |
| selected | boolean | Defines if the button state is selected. This property is available since version 1.3.3. | false |
| group | string | Indicates the group name the button belongs to. This property is available since version 1.3.3. | null |
| plain | boolean | If set to true, display a simple effect. | false |
| text | string | The button text. | '' |
| iconCls | string | The CSS class to display a 16x16 icon on the left. | null |
| iconAlign | string | The position of the button icon. Possible values: 'left', 'right'. This property is available since version 1.3.2. | left |
Methods
| Name | Parameter | Description |
|---|---|---|
| options | none | Returns the options property. |
| disable | none | Disable the button. <br>Code example: $('#btn').linkbutton('disable'); |
| enable | none | Enable the button. <br>Code example: $('#btn').linkbutton('enable'); |
| select | none | Select the button. This method is available since version 1.3.3. |
| unselect | none | Unselect the button. This method is available since version 1.3.3. |