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.
Create a linkbutton from markup is more easily.
- <a id="btn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'">easyui</a>
Create a linkbutton programmatically is also allowed.
- <a id="btn" href="#">easyui</a>
- $('#btn').linkbutton({
- iconCls: 'icon-search'
- });
Clicking on linkbutton will send the user to other page.
- <a href="otherpage.php" class="easyui-linkbutton" data-options="iconCls:'icon-search'">easyui</a>
The example below 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');
- });
- });
Name | Type | Description | Default |
---|---|---|---|
id | string | The id attribute of this component. | null |
disabled | boolean | True to disable the button | false |
toggle | boolean | True to enable the user to switch its state to selected or unselected. This property is available since version 1.3.3. | false |
selected | boolean | Defines if the button's state is selected. This property is available since version 1.3.3. | false |
group | string | The group name that indicates what buttons belong to. This property is available since version 1.3.3. | null |
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 |
iconAlign | string | Position of the button icon. Possible values are: 'left','right'. This property is available since version 1.3.2. | left |
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'); |
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. |