I have a model Kendo window that gets displayed on a large page. The window contains a scrollable grid. Whenever I hit the end of scrolling in the grid, the main webpage scrolls and the window stays where it is. Is there anyway that can be fixed?
4 Answers, 1 is accepted
0
Accepted
Hello Kyle,
Alex Gyoshev
the Telerik team
You can remove the document scroll with the following line (when the window gets opened):
$("html, body").css("overflow", "hidden");
When the window gets closed, restore the overflow styles with:
$("html, body").css("overflow", "");
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

Kyle
Top achievements
Rank 1
answered on 15 Aug 2012, 07:06 PM
Thanks, I modified my window with the following:
$('#myWindow').kendoWindow({
modal: true,
open: function(e) { $("html, body").css("overflow", "hidden"); },
close: function(e) { $("html, body").css("overflow", ""); }
};
And that seems to work great.
$('#myWindow').kendoWindow({
modal: true,
open: function(e) { $("html, body").css("overflow", "hidden"); },
close: function(e) { $("html, body").css("overflow", ""); }
};
And that seems to work great.
0
Hello Kyle,
Please keep in mind that there are browsers that reset an element's scroll position when the overflow style is changed. You may want to save and restore the document's scroll position in the open/close handlers (if necessary).
Greetings,
Dimo
the Telerik team
Please keep in mind that there are browsers that reset an element's scroll position when the overflow style is changed. You may want to save and restore the document's scroll position in the open/close handlers (if necessary).
Greetings,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

Kyle
Top achievements
Rank 1
answered on 17 Aug 2012, 11:37 AM
Thanks for the tip!