From abc55fa61dedcc2171b1fe23e3f6a2c2e8e7d5a6 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Mon, 2 May 2016 14:35:59 +0200 Subject: [PATCH] fix combogrid multiselect bug this fixes a nasty combogrid/multiselect/storeload bug in which the value of a combogrid gets set to a string instead of an array, under certain circumstances we overwrite the getRawValue method of our ComboGrid, and on multiselect ComboGrids, we just get the value out of me.rawValue, else we call the method of the parent class Signed-off-by: Dominik Csapak --- www/manager6/form/ComboGrid.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/www/manager6/form/ComboGrid.js b/www/manager6/form/ComboGrid.js index 7aff5de9..bc1b2815 100644 --- a/www/manager6/form/ComboGrid.js +++ b/www/manager6/form/ComboGrid.js @@ -30,6 +30,25 @@ Ext.define('PVE.form.ComboGrid', { // needed to trigger onKeyUp etc. enableKeyEvents: true, + // override ExtJS method + // if the field has multiSelect enabled, the store is not loaded, and + // the displayfield == valuefield, it saves the rawvalue as an array + // but the getRawValue method is only defined in the textfield class + // (which has not to deal with arrays) an returns the string in the + // field (not an array) + // + // so if we have multiselect enabled, return the rawValue (which + // should be an array) and else we do callParent so + // it should not impact any other use of the class + getRawValue: function() { + var me = this; + if (me.multiSelect) { + return me.rawValue; + } else { + return me.callParent(); + } + }, + // override ExtJS protected method onBindStore: function(store, initial) { var me = this,