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 <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2016-05-02 14:35:59 +02:00 committed by Dietmar Maurer
parent 34887e4479
commit abc55fa61d

View File

@ -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,