From d835d779295368c142279809bf77ae6875133942 Mon Sep 17 00:00:00 2001 From: ghiscoding Date: Fri, 14 Jul 2023 20:24:03 -0400 Subject: [PATCH] fix: add new grid option `scrollRenderThrottling`, fixes #219 - an old commit added a scroll throttling to the scroll to 50ms which adds a period of blank screen when scrolling on a large dataset, we should add a grid option to the users if they want to customize this throttling - the issue was discussed under issue #219 --- slick.grid.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/slick.grid.js b/slick.grid.js index edb832c4..d4b55999 100644 --- a/slick.grid.js +++ b/slick.grid.js @@ -104,6 +104,7 @@ if (typeof Slick === "undefined") { autosizeColsMode: Slick.GridAutosizeColsMode.LegacyOff, autosizeColPaddingPx: 4, autosizeTextAvgToMWidthRatio: 0.75, + scrollRenderThrottling: 50, viewportSwitchToScrollModeWidthPercent: undefined, viewportMinWidthPx: undefined, viewportMaxWidthPx: undefined, @@ -234,7 +235,7 @@ if (typeof Slick === "undefined") { var pagingActive = false; var pagingIsLastPage = false; - var scrollThrottle = ActionThrottle(render, 50); + var scrollThrottle; // async call handles var h_editorLoader = null; @@ -330,6 +331,7 @@ if (typeof Slick === "undefined") { // calculate these only once and share between grid instances maxSupportedCssHeight = maxSupportedCssHeight || getMaxSupportedCssHeight(); options = utils.extend(true, {}, defaults, options); + scrollThrottle = ActionThrottle(render, options.scrollRenderThrottling); validateAndEnforceOptions(); columnDefaults.width = options.defaultColumnWidth;