1. Main configuration items of Ext. Form. Field. Number
Configuration item |
Type |
Description |
Allowdecimals |
Boolean |
Whether to allow decimals. The default value is true. |
Autostripchars |
Boolean |
Whether to filter characters that are not allowed. The default value is false. |
Basechars |
String |
A set of valid numbers. The default value is 0123456789" |
Decimalprecision |
Number |
The precision of the input number. The default value is to retain the last two digits of the decimal point. |
Decimalseparator |
String |
Decimal separator. The default value is "." |
Maxvalue |
Number |
Maximum value that can be input. The default value is number. max_value. |
Maxtext |
String |
A message is prompted when the input exceeds the maximum value. |
Minvalue |
Number |
The minimum value that can be input. The default value is number. neative_infinty. |
Mintext |
String |
Prompt message with input value less than minimum |
Nantext |
String |
Prompt message after a non-valid value is entered |
Negativetext |
String |
Error message when the input is negative and the minvalue is set to 0 |
Step |
Number |
Set the number interval when the fine-tuning button is provided to increase or decrease the value. The default value is 1. |
2. Ext. Form. Field. Number example
Code:
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > < Html Xmlns = "Http://www.w3.org/1999/xhtml" > < Head Runat = "Server" > < Title > Ext. Field. Field. formpanel example </ Title > < Link Href = "Ext-4.0.7-gpl/resources/CSS/ext-all.css" REL = "Stylesheet" Type = "Text/CSS" /> < Script SRC = "Ext-4.0.7-gpl/Bootstrap. js" Type = "Text/JavaScript" > </ Script > < Script Type = "Text/JavaScript" > Ext. onready ( Function () {Ext. quicktips. INIT (); VaR FRM = New Ext. Form. formpanel ({Title: " Ext. Field. Field. formpanel example " , Bodystyle: " Padding: 5 " , Renderto: Ext. getbody (), frame: True , Height: 150 , Width: 270 , Defaulttype: " Numberfield " , Defaults: [{labelseparator: " : " , Labelwidth: 60 , Width: 200 , Labelalign: " Left " , Magtarget: " Side " }], Items: [{fieldlabel: " Integer " , Hidetrigger: True , // Hide the tune button Allowdecimals: False , // Decimal places are not allowed. Nantext: " Enter a valid integer. " }, {Fieldlabel: " Decimal " , Decimalprecision: 2 , // Exact two decimal places Allowdecimals: True , Nantext: " Enter a valid decimal number. " }, {Fieldlabel: " Number Limit " , Basechars: " 12345 " }, {Fieldlabel: " Numerical limit " , Maxvalue: 100 , // Maximum Value Minvalue: 50 // Minimum value }]}) ;}); </ Script > </ Head > < Body > </ Body > </ Html >
: