mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-11 16:49:11 +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,
|
skipEmptyText: false,
|
||||||
notFoundIsValid: false,
|
notFoundIsValid: false,
|
||||||
deleteEmpty: false,
|
deleteEmpty: false,
|
||||||
|
errorHeight: 100,
|
||||||
},
|
},
|
||||||
|
|
||||||
// needed to trigger onKeyUp etc.
|
// needed to trigger onKeyUp etc.
|
||||||
@ -302,8 +303,8 @@ Ext.define('Proxmox.form.ComboGrid', {
|
|||||||
picker.on('show', function() {
|
picker.on('show', function() {
|
||||||
me.store.fireEvent('refresh');
|
me.store.fireEvent('refresh');
|
||||||
if (me.enableLoadMask) {
|
if (me.enableLoadMask) {
|
||||||
me.savedMinHeight = picker.getMinHeight();
|
me.savedMinHeight = me.savedMinHeight ?? picker.getMinHeight();
|
||||||
picker.setMinHeight(100);
|
picker.setMinHeight(me.errorHeight);
|
||||||
}
|
}
|
||||||
if (me.loadError) {
|
if (me.loadError) {
|
||||||
Proxmox.Utils.setErrorMask(picker.getView(), me.loadError);
|
Proxmox.Utils.setErrorMask(picker.getView(), me.loadError);
|
||||||
@ -463,7 +464,10 @@ Ext.define('Proxmox.form.ComboGrid', {
|
|||||||
} else {
|
} else {
|
||||||
let msg = Proxmox.Utils.getResponseErrorMessage(o.getError());
|
let msg = Proxmox.Utils.getResponseErrorMessage(o.getError());
|
||||||
if (me.picker) {
|
if (me.picker) {
|
||||||
|
me.savedMinHeight = me.savedMinHeight ?? me.picker.getMinHeight();
|
||||||
|
me.picker.setMinHeight(me.errorHeight);
|
||||||
Proxmox.Utils.setErrorMask(me.picker.getView(), msg);
|
Proxmox.Utils.setErrorMask(me.picker.getView(), msg);
|
||||||
|
me.picker.updateLayout();
|
||||||
}
|
}
|
||||||
me.loadError = msg;
|
me.loadError = msg;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user