Slickgrid resize causes a scroll break at the bottom

I have the following problem: I use Slickgrid in conjunction with jquery layout. With this plugin you can resize panels. When I resize the Slickgrid panel so that a horizontal scrollbar appears that was not there before, I cannot scroll all the way to the end.

I created jsfiddle to demonstrate: http://jsfiddle.net/uNMRT/2/

Steps to play:

  • make sure the slickgrid panel does not have a horizontal scrollbar.
  • scroll all the way. (works well, you can view record 119, last)
  • resize the slickgrid panel using a vertical splitter. Make sure the slickgrid is smaller so that a horizontal scrollbar appears.
  • scroll down the page again. Please note that you cannot fully scroll down. Record 119 may not be visible now.

I already do resizeCanvas when resizing:

center__onresize: function(pane, $pane, state, options) { myGrid.resizeCanvas(); } 

This is not obvious enough. Any ideas?

+4
source share
3 answers

I ran into the same problem and it seems that this smoothing grid does not set the "viewportHasHScroll" flag correctly. I found the following two workarounds to fix the problem (SlickGrid v2.1)

1) Update the updateCanvasWidth function (line 396) and change the following line

 viewportHasHScroll = (canvasWidth > viewportW - scrollbarDimensions.width); 

(note the sign "greater than or equal to"

 viewportHasHScroll = (canvasWidth >= viewportW - scrollbarDimensions.width); 

2) Update the handleScroll function (line 1920) and update the if block

  //only scroll if they've moved at least one row if(vScrollDist && (vScrollDist > options.rowHeight)) { .... } 
+12
source

I ran into the same problem, but for vertical scrolling. If the container is resized, the vertical scrollbar does not scroll completely. He stops at the second last record. Although there is a space for scrolling, it cannot be completely moved down. If I pull it down, the net jumps over and the plank returns to its original position again. The last record can never be viewed.

+3
source

I had a problem when adding a line. This is because you might not have updated the grid correctly. You must call grid.updateRowCount ();

+1
source

Source: https://habr.com/ru/post/1443449/


All Articles