Nakres Nakres - 1 month ago 24
Javascript Question

move scrollbar to a specific row by seacrh fields in slickgrid

I have a filter in my slickgrid which works fine. Instead of filtering I want to move scrollbar of the slick grid to specific row when I type in search fields and if it matches to anything in my list.enter image description here

Answer

The SlickGrid API has a public method called scrollRowIntoView(row, doPaging).

Where paraters are:

row - A row index.

doPaging - A boolean. If false, the grid will scroll so the indicated row is at the top of the view. If true, the grid will scroll so the indicated row is at the bottom of the view. Defaults to false.

So by issuing:

grid.scrollRowIntoView(200, true);

Will scroll the given row number into the viewport of your grid.

Comments