[pve-devel] [PATCH manager] fix kvcombobox validator

Dominik Csapak d.csapak at proxmox.com
Wed Nov 23 11:12:34 CET 2016


since we often use the kvcombobox not statically but load its store at
runtime, we need to check the store and not the comboItems

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/form/KVComboBox.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/www/manager6/form/KVComboBox.js b/www/manager6/form/KVComboBox.js
index a135f4d..5263ed0 100644
--- a/www/manager6/form/KVComboBox.js
+++ b/www/manager6/form/KVComboBox.js
@@ -40,9 +40,9 @@ Ext.define('PVE.form.KVComboBox', {
 	    return true;
 	}
 
-	if (me.comboItems) {
+	if (me.store.getCount() > 0) {
 	    var values = me.multiSelect ? val.split(me.delimiter) : [val];
-	    var items = Ext.Array.pluck(me.comboItems, 1);
+	    var items = me.store.getData().collect('value', 'data');
 	    if (Ext.Array.every(values, function(value) {
 		return Ext.Array.contains(items, value);
 	    })) {
-- 
2.1.4





More information about the pve-devel mailing list