Skip to content

Commit

Permalink
fix: add new grid option scrollRenderThrottling, fixes #219
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
ghiscoding committed Jul 15, 2023
1 parent 4b06690 commit d835d77
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion slick.grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit d835d77

Please sign in to comment.