This is a migrated thread and some comments may be shown as answers.

submittting value in grid cause page scroll

2 Answers 43 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Maksim
Top achievements
Rank 1
Maksim asked on 20 Feb 2016, 06:52 AM

We have intergrated grid in our page but have one problem
We have some static div and grid without inner scroll,

<div>

<grid without scroll>
both the header div and table are scrolled by global scroll

The problem can be illustrated here (see attachement)
http://demos.telerik.com/kendo-ui/grid/editing

Why global scroll changes position after entering or adding value in grid?
Our operator edits and adds many values a day, we want global page scroll to stay in same position

What are workarounds?

2 Answers, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 25 Feb 2016, 09:34 AM
Hello Maksim,

I am sorry for the delayed response.

The described undesired behavior is caused by the browsers' rendering engines attempt to scroll the focused element into view. In this case, after the "Enter", "Tab", or "Escape" key is pressed after editing a cell, the table element of the Grid gains focus and the page is autoscrolled.

Unfortunately this default browser behavior cannot be overriden in the widget implementation, but I can suggest the following workarounds:

1) Use the mouse instead of the keyboard for navigation between the cells

2) Use JavaScript or jQuery to get the offset of the currently edited element (#grid_active_cell) and scroll the page to it on an event of your choice (keyup when the key is Enter, Tab, or Escape, blur, etc.). The concrete implementation of this option is beyond the scope of the Kendo UI Support services. If you would like further assistance with the matter, please consider Telerik Professional Services.

I hope this helps.

Regards,
Dimiter Topalov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Maksim
Top achievements
Rank 1
answered on 26 Feb 2016, 07:39 AM
Thank you sir for the option 2) hint
Tags
Grid
Asked by
Maksim
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Maksim
Top achievements
Rank 1
Share this question
or