]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
node/Task: show errors on store load
authorDominik Csapak <d.csapak@proxmox.com>
Mon, 5 Jul 2021 14:34:01 +0000 (16:34 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 5 Jul 2021 14:44:37 +0000 (16:44 +0200)
since we use a buffered store on a grid, we cannot use our
normal monStoreErrors from Utils (The store on the grid is a memorystore
without our 'proxmox' proxy, and the store in the viewmodel is not
initialized yet in the init)

simply set the mask in the already existing 'updateLayout' function
which is exactly the right place for the buffered store load

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/node/Tasks.js

index d93111bc256a9d6e32aa0714d36024d0c1bc8c03..dfe93dc3687ec4eb00f21761032c5af41672d1e4 100644 (file)
@@ -36,12 +36,18 @@ Ext.define('Proxmox.node.Tasks', {
            }).show();
        },
 
-       updateLayout: function() {
+       updateLayout: function(store, records, success, operation) {
            let me = this;
+           let view = me.getView().getView(); // the table view, not the whole grid
+           Proxmox.Utils.setErrorMask(view, false);
            // update the scrollbar on every store load since the total count might be different.
            // the buffered grid plugin does this only on (user) scrolling itself and even reduces
            // the scrollheight again when scrolling up
            me.getView().updateLayout();
+
+           if (!success) {
+               Proxmox.Utils.setErrorMask(view, Proxmox.Utils.getResponseErrorMessage(operation.getError()));
+           }
        },
 
        refresh: function() {
@@ -83,14 +89,8 @@ Ext.define('Proxmox.node.Tasks', {
            let vm = me.getViewModel();
            vm.set('showFilter', pressed);
        },
-
-       init: function(view) {
-           let me = this;
-           Proxmox.Utils.monStoreErrors(view, view.getStore(), true);
-       },
     },
 
-
     listeners: {
        itemdblclick: 'showTaskLog',
     },