SlickGrid's vertical scrollbar does not display properly if the filter is not displayed / hidden to resize the viewport

I'm just starting to use SlickGrid, but I have had great success creating a remote model that can interact with the swap plugin. The only problem I came up with was the problem with the browser, but I'm curious if anyone knows a trick that can solve the problem.

I retrieve page data in my model through AJAX and update the grid using the grid.setData() and grid.render() methods.

The problem I would like to solve is that when the data length changes, the vertical scrollbar really gets tangled up unless I change the current visibility of the filter panel ( grid.hideTopPanel() or grid.showTopPanel() ). Confused, I mean that the scroll knob in the scroll bar does not resize to indicate a different number of lines that are currently current, and if the list grows, the size of the scroll knob jumps all over the space as I scroll up and down,

I assume that โ€œfixโ€ works because it forces the browser to recount the height of the view port, but is there a way to make this happen? Or is there a better way to do what I'm trying to do?

+4
source share
3 answers

Ok meybman straightened me, I was really looking for grid.updateRowCount() . I suppose it will add a call to this in grid.setData() , but for now, just make sure the two method calls are used together.

+3
source

Have you tried grid.invalidate() ? Im my experience that makes the grid recount almost everything. This may be harder than you need, but at least you can see if the complete invalidation resolves the issue.

0
source

I get it. You need to call grid.resizeCanvas() after calling grid.setData() . It looks like this should be part of the grid.setData() method, because calling it will change the number of rows. But still, what you need to do.

0
source

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


All Articles