Using *Field outside of an editor grid - Ext JS

本文讨论了如何在ExtJS框架中用NumberField组件替换普通的文本输入框,以实现数值输入的有效验证和管理。提供了创建NumberField实例并将其应用于特定ID元素的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

The Number|Text etc fields are very useful in my grids, so I'd like to use them in forms otherwise. Following the path of inheritance is pretty difficult... can anybody tell me what I might do to replace an ordinary input type='text', for example, with a NumberField?

thanks!
Reply With Quote
  #2  
Old 03-15-2007, 08:01 PM
Default

var x = new Ext.form.NumberField();
x.applyTo("id");
Reply With Quote
  #3  
Old 03-15-2007, 08:13 PM
Default

Quote:
Originally Posted by harley.333
var x = new Ext.form.NumberField();
x.applyTo("id");
Thanks!
Reply With Quote
  #4  
Old 03-15-2007, 10:54 PM
Default

Have a look at the form example which isn't in the doc menu yet. It's not fully finished, but works and has lots of samples for exactly this.
Reply With Quote
  #5  
Old 03-15-2007, 11:17 PM
Default

I blogged about the inheritance chain of the form fields about a week ago. Also have some of the undocumented properties of the TextField config options. As always, it's undocumented and we're dealing with alpha code; so don't take any of this as being 'stable'.

http://www.divergingpath.com/index.c...eld-Validation
Reply With Quote
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值