]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
node/Tasks: improve scroller behaviour on datastore loading
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 25 Sep 2020 14:13:27 +0000 (16:13 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 29 Sep 2020 07:15:26 +0000 (09:15 +0200)
when we have a fixed totalcount, the scrollbar behaves nicely,
but sometimes we do not have a fixed total, so the api will return
'+1' if there are more elments to load

when doing this, the scrollbar has a weird behaviour where it changes
size frequently the more one scrolls down.

instead, tell the grid to update its layout as soon as the store
prefetches the data, which triggers an update of the scrollbar

this still lets it jump around a little, but only once per load and
more consistent

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

index c41f0b52dab26004b90fd168670d55455f03a4bf..2d8730050fc768b981ed22d88b35ead584e4c627 100644 (file)
@@ -28,6 +28,14 @@ Ext.define('Proxmox.node.Tasks', {
            },
        });
 
+       store.on('prefetch', function() {
+           // we want to update the scrollbar on every store load
+           // since the total count might be different
+           // the buffered grid plugin does this only on scrolling itself
+           // and even reduces the scrollheight again when scrolling up
+           me.updateLayout();
+       });
+
        let userfilter = '';
        let filter_errors = 0;