jQuery EasyUI Form Plugin -Numberspinner


jQuery EasyUI 插件jQuery EasyUI Plugins

Extends from $.fn.spinner.defaults and $.fn.numberbox.defaults. Override the default defaults via $.fn.numberspinner.defaults.

The numberspinner is created based on the spinner and the numberbox. It can convert the input value to different types (such as: numeric, percentage, currency, etc.). It allows the user to scroll to a desired value using the up/down spinner buttons.

Dependencies

  • spinner
  • numberbox

Usage

Create a numberspinner from markup.

<input id="ss" class="easyui-numberspinner" style="width:80px;"
    required="required" data-options="min:10,max:100,editable:false">

Create a numberspinner using JavaScript.

<input id="ss" required="required" style="width:80px;">
$('#ss').numberspinner({
    min: 10,
    max: 100,
    editable: false
});

Create a numberspinner and format the number as a currency string.

<input class="easyui-numberspinner" value="1234567890" style="width:150px;"
    data-options="required:true,precision:2,groupSeparator:',',decimalSeparator:'.',prefix:'$'">

Properties

The properties extend from spinner and numberbox.

Events

The events extend from spinner.

Methods

The methods extend from spinner. Below are the methods overridden for the numberspinner.

Name Parameters Description
options none Returns the options object.
setValue value Set the value of the numberspinner.
Code example:
$('#ss').numberspinner('setValue', 8234725);  // set value
var v = $('#ss').numberspinner('getValue');  // get value
alert(v)

jQuery EasyUI 插件jQuery EasyUI Plugins Other Extensions