jQuery EasyUI Form Plugin - Timespinner
jQuery EasyUI Plugins
Extends $.fn.spinner.defaults. Override the default defaults via $.fn.timespinner.defaults.
The timespinner is created based on the spinner. It is similar to the numberspinner, but it displays only time values. The timespinner allows users to increase or decrease the time by clicking the small spinner buttons on the right of the component.
Depends on
- spinner
Usage
Create a timespinner from markup.
Create a timespinner using JavaScript.
$('#ss').timespinner({
min: '08:30',
required: true,
showSeconds: true
});
property
This property extends from the spinner; the following are properties added for the timespinner.
| Name | Type | Description | Default value |
|---|---|---|---|
| separator | string | The separator between hours, minutes, and seconds. | : |
| showSeconds | boolean | Defines whether to show seconds. | false |
| highlight | number | The initially highlighted field: 0 = hour, 1 = minute, ... | 0 |
Events
This event extends from the spinner.
Method
This method extends from the spinner; the following are methods overridden for the timespinner.
| Name | Parameters | Description |
|---|---|---|
| options | none | Return the options object. |
| setValue | value | Sets the value of the timespinner. |
代码实例:
$('#ss').timespinner('setValue', '17:45'); // set timespinner value var v = $('#ss').timespinner('getValue'); // get timespinner value alert(v);| onSelect | event | getHours | none | Get the current hour value.| onSelect | event | getMinutes | none | Get the current minute value.| onSelect | event | getSeconds | none | Get the current second value. |
jQuery EasyUI Plugins