New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scrollTo() method #183
Comments
very easy with a plugin, get the grid instance and use grid.$viewport.scrollTop(rowIndex * grid.config.rowHeight) or for sorted data: |
we may end up just appending the grid instance to the options for easier access. |
It works with virtual scrolling too? On Sat, Feb 23, 2013 at 2:05 AM, Tim Sweet notifications@github.com wrote:
|
Yes On Saturday, February 23, 2013, TomKaltz wrote:
-Tim Sweet |
added in 29b3bcb |
has the code been changed? |
Agreed. @timothyswt There doesn't seem to be an obvious or documented way to scroll the grid from code anymore. |
My hack/workaround for now...
|
I think you're mixing 2.x and 3.0. The majority of this issue relates to 2.x I think, the last one from @dprothero looks like 3.0/ui-grid code. For @dprothero, the cellNav feature provides the scrollTo functionality, and I believe that swalters is currently in the process of moving it into core. |
@dprothero Did you find a better solution? I am using a similar hack:
For me, I want to show the selected (at rowIndex) at the top of the grid view. |
@dprothero The hack doesn't work after the user sorts the table. |
My solution is to decorate uiGridDirective and then override the scrollTo and scrollToIfNecessary methods. The key is set up the scrollEvent.y according my business rule. |
I was not able to get the precise landing pixel. But I spotted the usage of
So I went back with the hack. This time, I am using something like this to get the rowIndex:
|
rowIndex = gridApi.grid.renderContainers.body.visibleRowCache.indexOf(gridApi.grid.rows[rowIndex]); Even above code is not working for me..did anyone solve it? In My case it works for 2-3 elements but after that it scrolls to end of the grid. |
Should be able to scroll to a certain row via an instance method. Also should be able to read the scrolling position somehow.
The text was updated successfully, but these errors were encountered: