jQuery EasyUI Basic Plugins - Progressbar
jQuery EasyUI Plugins
Override the default defaults through $.fn.progressbar.defaults.
A progressbar provides feedback showing the progress of a long-running operation. The progress can be updated to let the user know what operation is currently being performed.
Depends on
- none
Usage
Creating a ProgressBar
A ProgressBar component can be created from html markup or programmatically. Creating it from markup is easier; just add the 'easyui-progressbar' class to the
Create a ProgressBar using javascript.
$('#p').progressbar({
value: 60
});
Getting or setting the value
We get the current value and set a new value for this component.
var value = $('#p').progressbar('getValue');
if (value < 100){
value += Math.floor(Math.random() * 10);
$('#p').progressbar('setValue', value);
}
property
| Name | Type | Description | Default value |
|---|---|---|---|
| width | string | Set the width of the progressbar. | auto |
| height | number | The height of the component. This property is available since version 1.3.2. | 22 |
| value | number | The percentage value. | 0 |
| text | string | The text template displayed on the component. | {value}% |
Events
| Name | Parameters | Description |
|---|---|---|
| onChange | newValue,oldValue | Triggered when the value changes. |
代码实例:
$('#p').progressbar({ onChange: function(value){ alert(value) } }); |
Method
| Name | Parameters | Description |
|---|---|---|
| options | none | Return the options object. |
| resize | width | Resize the component. |
代码实例:
$('#p').progressbar('resize'); // resize the progress bar to its initial width $('#p').progressbar('resize', 350); // resize the progress bar to a new width| onSelect | event | getValue | none | Return the current progress value.| onSelect | event | setValue | value | Set a new progress value. |
jQuery EasyUI Plugins