Ext.form.field.Number numberfield
2012-11-14 20:45
295 查看
A numeric text field that provides automatic keystroke filtering to disallow non-numeric characters, and numeric validation to limit the value to a range of valid numbers.(数据字段提供了自动过滤键盘输入的非数据字符,和数据校验限制在合法数据的范围中。) The range of acceptable number values can be controlled by setting the minValue and maxValue configs, and fractional decimals can be disallowed by setting allowDecimals to
By default, the number field is also rendered with a set of up/down spinner buttons and has up/down arrow key and mouse wheel event listeners attached for incrementing/decrementing the value by the step value. (默认情况下,数据字段提供了一组上下转换的按钮和上下箭头按键和鼠标轮滚事件监听器控制数据的步进来递增和递减数值。)To hide the spinner buttons set
numberfield.html
numberfield.js
numberfield2.js
numberfield3.js
11111
本文出自 “智源软件” 博客,请务必保留此出处http://gzzjsoft.blog.51cto.com/6129059/1060084
false.(可以设置minValue和maxValue属性控制可接受数据的范围,通过设置allowDecimals为false限制小数输入)
By default, the number field is also rendered with a set of up/down spinner buttons and has up/down arrow key and mouse wheel event listeners attached for incrementing/decrementing the value by the step value. (默认情况下,数据字段提供了一组上下转换的按钮和上下箭头按键和鼠标轮滚事件监听器控制数据的步进来递增和递减数值。)To hide the spinner buttons set
hideTrigger:true; to disable the arrow key and mouse wheel handlers set
keyNavEnabled:falseand
mouseWheelEnabled:false. (要隐藏上下转换按钮可以设置hideTrigger为true,要取消上下键事件和鼠标滚动事件可以设置keyNavEnabled为false和设置mouseWheelEnabled为false。)See the example below.(看下面的例子。)
numberfield.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>HELLO WORD</title> <link rel="stylesheet" type="text/css" href="../extjs-4.1.0/resources/css/ext-all.css"/> <script type="text/javascript" src="../extjs-4.1.0/bootstrap.js"></script> <script type="text/javascript" src="numberfield3.js"></script> </head> <body> </body> </html>
numberfield.js
(function(){ Ext.onReady(function(){ Ext.create('Ext.form.Panel', { title: 'On The Wall', width: 300, bodyPadding: 10, renderTo: Ext.getBody(), items: [{ xtype: 'numberfield', anchor: '100%', name: 'bottles', fieldLabel: 'Bottles of Beer', value: 99, maxValue: 99, minValue: 0 }], buttons: [{ text: 'Take one down, pass it around', handler: function() { this.up('form').down('[name=bottles]').spinDown(); } }] }); }); })();
numberfield2.js
(function(){ Ext.onReady(function(){ Ext.create('Ext.form.Panel', { title: 'Personal Info', width: 300, bodyPadding: 10, renderTo: Ext.getBody(), items: [{ xtype: 'numberfield', anchor: '100%', name: 'age', fieldLabel: 'Age', minValue: 0, //prevents negative numbers // Remove spinner buttons, and arrow key and mouse wheel listeners hideTrigger: true, keyNavEnabled: false, mouseWheelEnabled: false }] }); }); })();
numberfield3.js
(function(){ Ext.onReady(function(){ Ext.create('Ext.form.Panel', { renderTo: Ext.getBody(), title: 'Step', width: 300, bodyPadding: 10, items: [{ xtype: 'numberfield', anchor: '100%', name: 'evens', fieldLabel: 'Even Numbers', // Set step so it skips every other number step: 2, value: 0, // Add change handler to force user-entered numbers to evens listeners: { change: function(field, value) { value = parseInt(value, 10); field.setValue(value + value % 2); } } }] }); }); })();
11111
本文出自 “智源软件” 博客,请务必保留此出处http://gzzjsoft.blog.51cto.com/6129059/1060084
相关文章推荐
- Ext.form.field.Number数字输入框
- Ext.form.NumberField的属性
- 关于Ext.form.NumberField中输入一个超大数字,失去焦点后变成另一个数字的bug的处理
- ExtJS之Ext.form.field.Number数字输入框
- Ext.form.field.Number示例
- ExtJS之Ext.form.field.Number组件实例
- Ext_数字输入框_Ext.form.NumberField
- Ext.form.NumberField使用
- Ext.form.field.Number的实例
- (11)ExtJS之Ext.form.field.Number数字输入框
- Ext.form.field.Spinner微调字段
- (12)ExtJS之Ext.form.field.Radio、Ext.form.field.Checkbox
- Ext.form.field.Checkbox和Ext.form.field.Radio示例
- Ext.form.field.ComboBox 切换store没有反应
- 继承Ext.form.TriggerField,实现树下拉选择(新增示例下载)
- Ext.form.TextField组件的基本用法
- ext.form.field.Date
- Extjs4中的Ext.form.field.Spinner
- Ext.form.field.CheckBox和Ext.form.field.Radio主要配置项目
- Ext.form.TextField组件