]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
combogrid: fix validation if valueField is different than displayField
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 16 Aug 2019 10:44:33 +0000 (12:44 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 16 Aug 2019 10:44:33 +0000 (12:44 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
form/ComboGrid.js

index aaaa107653b706e8e1cafcdb26f6e2f0e3d33dad..c3e778237ca798d2cac9d4f1048ed28ec5c8da5c 100644 (file)
@@ -340,6 +340,13 @@ Ext.define('Proxmox.form.ComboGrid', {
            return true; // handled later by allowEmpty in the getErrors call chain
        }
 
+       // we normally get here the displayField as value, but if a valueField
+       // is configured we need to get the "actual" value, to ensure it is in
+       // the store. Below check is copied from ExtJS 6.0.2 ComboBox source
+       if (me.valueField && me.valueField !== me.displayField) {
+           value = me.getValue();
+       }
+
        if (!(me.notFoundIsValid || me.isValueInStore(value))) {
            return gettext('Invalid Value');
        }