I have a grid which contains many lines and a line in the middle of the grid is selected. The grid is refreshed on button click. But that grid doesn’t have focus (it is hidden behind a jQuery accordion which is not active). The content of the grid is refreshed but the scrollbar remains at its original place. How to reset the scrollbar to the top of the grid?
Please, try to use the following code:
mygrid.objBox.scrollTop=0
hi sematik,
unfortunately this doesn’t work… the scrollbar remained where it was.
Could you please, provide with a complete demo, where the problem can be reconstructed locally.
Here you can find a tutorial about creating a complete demo:
docs.dhtmlx.com/tutorials__auxil … pport.html
hi sematik
here is the sample webpage:
http://tiborzsitva.szm.com/d2/refresh-scrolling.html
- click on “refresh” (data will be loaded into grid on Section 4)
- click on “Section 4”
- scroll down and select item for example 22 (High porosity)
- click on “Section 1”
- click on “refresh” (data will be reloaded into grid on Section 4)
- click on “Section 4”
Notice that selection disappeared (it means reload happened) but the scrollbar remained at its original place. I need the scrollbar at the top
Unfortunately this is the specific behavior of the jquery accordion.
I may only suggest you to use another accordion or you may try to update the scroll position right when the panel with the grid is get expanded.