开发者

why doesn't Ext.form.field.disable automatically revalidate

开发者 https://www.devze.com 2023-03-11 11:52 出处:网络
var bFoo = foo === \"true\"; cmp.setDisabled(!bFoo ); //disabled always passes validation cmp.validate();
    var bFoo = foo === "true";
    cmp.setDisabled(!bFoo ); //disabled always passes validation
    cmp.validate();

why doesn't Ext 3.3 call validate, or clearInvalid, for us in Ext.form.field.disable() ?

when the field is disabled, the invalid-style incorrectly lingers until the field is next validated. I think it should always validate immediately, or clear the style开发者_C百科.

this also happens with enable() on a field with allowBlank=false; the disabled-style goes away, but the invalid-style doesn't appear until the user clicks, which is wrong.


Because disabled fields aren't submitted, so it doesn't matter if they're valid. Also, because disabled fields are disabled, the (non-programmer) user can't change the invalid value(s).

0

精彩评论

暂无评论...
验证码 换一张
取 消