Easyui Numberbox onchange Binding

Source: Internet
Author: User
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
    }
  });

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.