jQuery EasyUI Menu and Button Plugin -Linkbutton
jQuery EasyUI Plugin
Override the default defaults via $.fn.linkbutton.defaults.
The linkbutton is used to create a hyperlink button. It is a representation of a normal <a> tag. It can display an icon and text, or only one of them. The button width can dynamically shrink/expand to fit its text label.
Usage
Create linkbutton
Creating a linkbutton from markup is easier.
<a id="btn" href="../index.html" class="easyui-linkbutton" data-options="iconCls:'icon-search'">easyui</a>
Creating a linkbutton programmatically is also allowed.
<a id="btn" href="../index.html">easyui</a>
$('#btn').linkbutton({
iconCls: 'icon-search'
});
Handle the clicks on the linkbutton.
A click on the linkbutton will navigate the user to another page.
<a href="otherpage.php.html" class="easyui-linkbutton" data-options="iconCls:'icon-search'">easyui</a>
The following example will alert a message.
<a href="../index.html" class="easyui-linkbutton" data-options="iconCls:'icon-search'"
onclick="javascript:alert('easyui')">easyui</a>
Use jQuery to bind the click handler.
<a id="btn" href="../index.html" class="easyui-linkbutton" data-options="iconCls:'icon-search'">easyui</a>
$(function(){
$('#btn').bind('click', function(){
alert('easyui');
});
});
Attributes
| Name | Type | Description | Default Value |
|---|---|---|---|
| id | string | The id attribute of the component. | null |
| disabled | boolean | If set to true, the button is disabled. | false |
| toggle | boolean | If set to true, the user is allowed to toggle the selected state of the button. This attribute is available since version 1.3.3. | false |
| selected | boolean | Defines whether the button state is selected. This attribute is available since version 1.3.3. | false |
| group | string | Indicates the group name to which the button belongs. This attribute is available since version 1.3.3. | null |
| plain | boolean | If set to true, a plain effect is displayed. | false |
| text | string | The button text. | '' |
| iconCls | string | A CSS class to display a 16x16 icon on the left. | null |
| iconAlign | string | The position of the button icon. Possible values: 'left', 'right'. This attribute is available since version 1.3.2. | left |
Methods
| Name | Parameters | Description |
|---|---|---|
| options | none | Return the options property. |
| disable | none | Disable the button. Code example:
$('#btn').linkbutton('disable');
|
| enable | none | Enable the button. 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. |
jQuery EasyUI Plugin Other Extensions