Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dependent field in EXT JS

Does EXT JS provide a mechanism for dependent fields? E.g. password field should not be active until the login has been entered.

like image 547
fastcodejava Avatar asked May 06 '11 00:05

fastcodejava


2 Answers

No, there is no buildin way to do this. But you can help yourself while using customValidator or any other event that fit your trigger-needs.

Modify the custom Validator on your username field to activates the disabled password field after the minimum username characters are reached.

Benefit of the customValidator is that it get's triggered while you type.

like image 182
sra Avatar answered Sep 22 '22 23:09

sra


I know there was a formBind config option in Ext 3.3 and it says there is someting in 4.0 but the docs aren't very good now. It works well with buttons but I've never used them on fields before.

per ExtJS API :

Any component within the FormPanel can be configured with formBind: true. This will cause that component to be automatically disabled when the form is invalid, and enabled when it is valid. This is most commonly used for Button components to prevent submitting the form in an invalid state, but can be used on any component type.

like image 40
pllee Avatar answered Sep 18 '22 23:09

pllee