Used in "Add USB to VM" dialog for example.
This was broken before
15206214d9 "ComboGrid: fix on-load validation for blank
values" (only the one you enabled first was validated, the other always showed
as valid), and afterwards too, but in a different way (both are now immediately
marked invalid until you select and unselect them) - which is how I noticed.
With this the validation now works correctly.
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
return true;
},
+ // validate after enabling a field, otherwise blank fields with !allowBlank
+ // are sometimes not marked as invalid
+ setDisabled: function(value) {
+ this.callParent([value]);
+ this.validate();
+ },
+
initComponent: function() {
var me = this;
me.setValue(def, true);
} else if (!me.allowBlank && !(Ext.isArray(def) ? def.length : def)) {
me.setValue(def);
- if (!me.notFoundIsValid) {
+ if (!me.notFoundIsValid && !me.isDisabled()) {
me.markInvalid(me.blankText);
}
}