I have a custom edit template on a kendo grid. The grid contains a couple hundred records. There is no paging and relies on the browser scroller to view records near the bottom of the page. Depending on the position of the record I edit, the window will re-position its scroller making it difficult to keep track of where you previously edited. I have managed to save the position of the window scroll
with jquery
position = $(window).scrollTop();
I want to then use
$(window).scrollTop(position);
to restore the position. In the console the restore works fine, but no matter what event I bind the above code to it still re-positions my scroll. Is there some event that fires that is grid independent after a update/cancel edit/add?
Lacking a reproducible example makes it a bit hard. Using my own test it seems to work fine.
You can try this:
function someEvent(e) {
e.preventDefault();
... your reposition code
}
Sometimes using a timeout works, so your code runs slightly after Kendo's.
function someEvent(e) {
setTimeout(function() {
... your reposition code
}, 10);
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.