reliance onValidatebox
usage
Create a number box (Numberbox) from the tag.
<input type= "text" class= "Easyui-numberbox" value= "data-options=" "Min:0,precision:2" >
Create a number box (Numberbox) using JavaScript.
<input type= "text" id= "nn" >
$ (' #nn '). Numberbox ({min:0, precision:2});
Property
This property extends the Validatebox box, which is the property added for the number box (Numberbox).
name |
type |
Description |
Default Value |
Disabled |
Boolean |
Defines whether the field is disabled. |
False |
Value |
Number |
The default value. |
|
Min |
Number |
The minimum allowable value. |
Null |
Max |
Number |
The maximum allowable value. |
Null |
Precision |
Number |
The maximum precision displayed after the decimal point. |
0 |
DecimalSeparator |
String |
A separator character that separates the integer and decimal parts of a number. |
. |
Groupseparator |
String |
A character that separates integer combinations. |
|
Prefix |
String |
The prefix string. |
|
Suffix |
String |
Suffix string. |
|
Filter |
Function (e) |
Defines how to filter the pressed key and returns true to accept the input character. This property is available from version 1.3.3. |
|
Formatter |
function (value) |
A function to format a numeric box (Numberbox) value. Returns the string value displayed in the box. |
|
Parser |
function (s) |
The function to parse the string. Returns the number box (Numberbox) value. |
|
Events
name |
Parameters |
Description |
OnChange |
Newvalue,oldvalue |
triggered when field values change. |
Method
This method extends the Validatebox, and the following methods are added or overridden for a number box (Numberbox).
name |
Parameters |
Description |
Options |
None |
Returns an Option object. |
Destroy |
None |
Destroys the numeric box (Numberbox) object. |
Disable |
None |
Disables the domain. |
Enable |
None |
Enable the domain. |
Fix |
None |
The value is fixed to a valid value. |
SetValue |
None |
Sets the value of the number box (Numberbox). Code instance:$ (' #nn '). Numberbox (' SetValue ', 206.12); |
GetValue |
None |
Gets the value of the number box (Numberbox). Code instance:var v = $ (' #nn '). Numberbox (' GetValue '); Alert (v); |
Clear |
None |
Clears the value of the number box (Numberbox). |
Reset |
None |
Resets the value of the number box (Numberbox). This method is available from version 1.3.2. |
* Summary: The binding method for the OnChange method is:
$ ("#workHour"). Numberbox ({
"OnChange": function () {
//do Something
}
});