jQuery EasyUI Menu and Button Plugin - Linkbutton
jQuery EasyUI Plugins
Override the defaults through $.fn.linkbutton.defaults.
A linkbutton is used to create a hyperlink button. It is the representation of a normal element. It can display both an icon and text, or just one of them. The button width can shrink/expand dynamically to fit its text label.
Usage
Creating a Linkbutton
It is easier to create a linkbutton from markup.
easyui
Creating a linkbutton programmatically is also allowed.
easyui
$('#btn').linkbutton({
iconCls: 'icon-search'
});
Handling clicks on a linkbutton.
A click on a linkbutton takes the user to another page.
easyui
The example below will alert a message.
easyui
Use jQuery to bind a click handler.
easyui
$(function(){
$('#btn').bind('click', function(){
alert('easyui');
});
});
property
| 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 property is available since version 1.3.3. | false |
| selected | boolean | Defines whether the button state is selected. This property is available since version 1.3.3. | false |
| group | string | Indicates the name of the group to which the button belongs. This property is available since version 1.3.3. | null |
| plain | boolean | If set to true, a simple effect is shown. | false |
| text | string | The button text. | '' |
| iconCls | string | A CSS class for displaying 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 |
Method
| Name | Parameters | Description |
|---|---|---|
| options | none | Returns the options property. |
| disable | none | Disables the button. |
代码实例:
$('#btn').linkbutton('disable');| onSelect | event | enable | none | Enable the button.
Code example:
$('#btn').linkbutton('enable');
| onSelect | event | select | none | Select the button. This method is available since version 1.3.3.| onSelect | event | unselect | none | Deselect the button. This method is available since version 1.3.3. |
jQuery EasyUI Plugins