mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-09 19:14:13 +00:00
ComboGrid: make height for the error configurable
by introducing a errorHeight config property. This is necessary when the ComboGrid has e.g. a toolbar and we show the error in the grid body only, 100 pixels is not enough then. To solve that without hardcoding different heights, let the subclass/caller configure that also set this when the store load fails completely (was not done until now) Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
aa157deb47
commit
c071b0c302
@ -31,6 +31,7 @@ Ext.define('Proxmox.form.ComboGrid', {
|
||||
skipEmptyText: false,
|
||||
notFoundIsValid: false,
|
||||
deleteEmpty: false,
|
||||
errorHeight: 100,
|
||||
},
|
||||
|
||||
// needed to trigger onKeyUp etc.
|
||||
@ -302,8 +303,8 @@ Ext.define('Proxmox.form.ComboGrid', {
|
||||
picker.on('show', function() {
|
||||
me.store.fireEvent('refresh');
|
||||
if (me.enableLoadMask) {
|
||||
me.savedMinHeight = picker.getMinHeight();
|
||||
picker.setMinHeight(100);
|
||||
me.savedMinHeight = me.savedMinHeight ?? picker.getMinHeight();
|
||||
picker.setMinHeight(me.errorHeight);
|
||||
}
|
||||
if (me.loadError) {
|
||||
Proxmox.Utils.setErrorMask(picker.getView(), me.loadError);
|
||||
@ -463,7 +464,10 @@ Ext.define('Proxmox.form.ComboGrid', {
|
||||
} else {
|
||||
let msg = Proxmox.Utils.getResponseErrorMessage(o.getError());
|
||||
if (me.picker) {
|
||||
me.savedMinHeight = me.savedMinHeight ?? me.picker.getMinHeight();
|
||||
me.picker.setMinHeight(me.errorHeight);
|
||||
Proxmox.Utils.setErrorMask(me.picker.getView(), msg);
|
||||
me.picker.updateLayout();
|
||||
}
|
||||
me.loadError = msg;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user