[pve-devel] applied: [PATCH proxmox-widget-toolkit] combogrid: fix validation if valueField is different than displayField

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Aug 16 12:45:09 CEST 2019


Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 form/ComboGrid.js | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/form/ComboGrid.js b/form/ComboGrid.js
index aaaa107..c3e7782 100644
--- a/form/ComboGrid.js
+++ b/form/ComboGrid.js
@@ -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');
 	}
-- 
2.20.1




More information about the pve-devel mailing list