[pbs-devel] [PATCH widget-toolkit 1/1] node/Tasks: improve scroller behaviour on datastore loading

Dominik Csapak d.csapak at proxmox.com
Fri Sep 25 16:13:27 CEST 2020


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 at proxmox.com>
---
 src/node/Tasks.js | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/node/Tasks.js b/src/node/Tasks.js
index c41f0b5..2d87300 100644
--- a/src/node/Tasks.js
+++ b/src/node/Tasks.js
@@ -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;
 
-- 
2.20.1






More information about the pbs-devel mailing list