Pending Review
Last Updated: 14 Aug 2018 08:48 by ADMIN
Ulrich
Created on: 30 May 2013 11:16
Category: Grid
Type: Feature Request
34
Add posibility to jump (scroll) to specific row when using virtual grid
When using Grid with virtual scrollbar there is no possibilty to go to sepecific row programaticly. Especially for row that are not yet loaded.

I have managed to move the scrolbar using 

grid.virtualScrollable.verticalScrollbar.scrollTop(scrollRow[0].offsetTop + pageOffset * pageIndex);

however the calcualtion of the location of the row is impossible when rows have dynamic height.
3 comments
David
Posted on: 23 May 2018 23:39
This is a feature we are really desired.
Anthony
Posted on: 10 Mar 2015 08:38
I have noticed this same question on the user forums and stackoverflow so this seems to be a common requirement. What's needed is either access to the grids scroller or grid.animatedScrollTo. When I alter scrollTop the scroller seems to get out of sync (this is on Android mobile, works on everything else)
Gordon
Posted on: 02 Oct 2014 15:52
this works in my case..

            var selected = t.mainGrid.select();
            if (selected.length == 0) return;
            //calculate scrollTop distance
            var vs = t.mainGrid.wrapper.find('.k-grid-content').data('kendoVirtualScrollable');
            //console.log(vs);
            var scrollGridContentOffset = t.mainGrid.wrapper.find('.k-grid-content').offset().top;
            var selectContentOffset = t.mainGrid.select().offset().top;
            var distance = selectContentOffset - scrollGridContentOffset;
            var scrollTop = vs.verticalScrollbar.scrollTop();
            console.log("selectContentOffset:" + selectContentOffset);
            console.log("scrollGridContentOffset:" + scrollGridContentOffset);
            console.log("distance:" + distance);
            console.log("scrollbar:" + scrollTop);
            
            vs.verticalScrollbar.animate({ scrollTop: distance + scrollTop }, 250);