Feature Request ext1: Field events - Ext JS

本文讨论了ExtJS 1.0版本中表单组件的功能改进,特别是关于有效性和无效性的事件支持。作者提出了增加事件的想法,并探讨了错误消息显示的可配置性,包括自定义显示方式和实现字段验证总结等功能。

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

Hey,

the form-widgets in 1.0 are very cool! One i missed: events for valid / invalid. I have tried a dialog which has to resize for the actual size. With the new feature in alpha3 to show invalid messages under the field, my dialog has to resize after it is invalid or valid. I think a event will be cool, like this (simply put at the end of clearInvalid() and markInvalid() in Ext.form.Field). Maybe it will be a good idea to give a config flag so the field doesnt loose their focus if its invalid.
Reply With Quote
  #2  
Old 03-09-2007, 04:53 AM
Default

Slightly OT, but I don't like the display of error messages under the fields! It throws out page layout.

The error display method should be configurable. eg, a config option:

    errorMethod: myfunc // Message is passed to the function called in scope of the field widget
Reply With Quote
  #3  
Old 03-09-2007, 04:59 AM
Default

Quote:
Originally Posted by Animal
The error display method should be configurable.
Thats an good idea too. I have seen that it is configurable only for all fields and how to show, this version with the method will give the developer complete control of it. Many many sites has an validation-summary too. In asp.net there you can put a validationsummary on you site which shows automatically the errors. Another good thing in asp.net that you has validation-groups, you can assign fields to this group and use a global method isValid(). With this, you can validate groups as its own.
Reply With Quote
  #4  
Old 03-09-2007, 04:38 PM
Default

invalid/valid events could fire very often but I agree, they need to be there. I will add them in.

Animal, the msgTarget is extremely configurable. The supported values 'qtip', 'title', 'under' or 'any element id'. The other option is to override the markInvalid/clearInvalid methods (which would be the function you're describing).
new Ext.form.TextField({
    allowBlank: false,
    markInvalid : function(msg){
       // do something
    },
    clearInvalid : function(){
       // do something
    }
});
Reply With Quote
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值