Is there a way to scroll the view of the application to the top?
I'm not talking about the Scroller control, but the view itself. My application loads content from the server and displays it using templates. The show_page.html looks something like this:
It works great, except if the user is viewing a large page, and has scrolled down - then goes back to the menu and selects a new site to view. show_page.html is shown once again, the new content is loaded through the js_page_side() function. It all works - but this new content is now shown already scrolled down to the position the user was before.
Any ideas?
I'm not talking about the Scroller control, but the view itself. My application loads content from the server and displays it using templates. The show_page.html looks something like this:
<
div
data-role
=
"view"
id
=
"page_side"
data-show
=
"js_page_side"
>
<
div
id
=
"foo"
></
div
>
<
script
id
=
"sidetemplate1"
type
=
"text/x-kendo-template"
>
<
h1
>#= overskrift #</
h1
>
<
p
>#= ingress #</
p
>
<
div
class
=
"brodtekst"
>
#= brodtekst #
</
div
>
</
script
>
</
div
>
<script>
function js_page_side() {
datakilde_sider.query({filter: {field:
"id"
, operator:
"eq"
, value: window[
'globalvar_vis_side_id'
] }});
$(
"#foo"
).html(kendo.render(sidetemplate1, datakilde_sider.view()));
//(Here there should be something forcing the view to scroll to top)
}
</script>
Any ideas?