I have a Kendo Grid that is setup with Virtual Paging and Navigatable (for keyboard navigation). Depending on the size of the content, sometimes I will not be able to see all the data in the current view.
When I use the mouse to scroll (mouse wheel or scroll bar), there's no issue. When I try to use the keyboard to navigate to the bottom rows, the rows do not scroll into view. Getting javascript to scroll the element into view is fairly straight-forward, but to make that happen automatically, you need hook into an event to trigger the scroll. My problem is that I can't seem to figure out how to hook into the focus event on the grid to automatically make it happen.
Using the browser console, I can force the grid to scroll using this code:
Here is a JSFiddle showing the issue: JSFiddle
How can I hook into the focus event to scroll the currently focused cell into view? Note that the currently focused cell is different from the selected cell/row. Clearly, there must be a way since Kendo updating the cell css class to show the currently focused cell. So, I'm hoping there's a way for me to subscribe to that event as well.
I don't want to use the change event because I am not changing the selection of the row, just changing the focus by navigating between cells using the arrow keys (and using the navigatable option). Also, I do need virtual paging setup - I know that turning off virtual paging will make this problem go away, but turning off virtual paging is not an option.
Thanks,
John
When I use the mouse to scroll (mouse wheel or scroll bar), there's no issue. When I try to use the keyboard to navigate to the bottom rows, the rows do not scroll into view. Getting javascript to scroll the element into view is fairly straight-forward, but to make that happen automatically, you need hook into an event to trigger the scroll. My problem is that I can't seem to figure out how to hook into the focus event on the grid to automatically make it happen.
Using the browser console, I can force the grid to scroll using this code:
$grd.animate({
scrollTop: $ele.offset().top - $grd.offset().top + $grd.scrollTop()
});
Here is a JSFiddle showing the issue: JSFiddle
How can I hook into the focus event to scroll the currently focused cell into view? Note that the currently focused cell is different from the selected cell/row. Clearly, there must be a way since Kendo updating the cell css class to show the currently focused cell. So, I'm hoping there's a way for me to subscribe to that event as well.
I don't want to use the change event because I am not changing the selection of the row, just changing the focus by navigating between cells using the arrow keys (and using the navigatable option). Also, I do need virtual paging setup - I know that turning off virtual paging will make this problem go away, but turning off virtual paging is not an option.
Thanks,
John