page position listview after refresh in client

0
I have a page with a custom calender widget on top of the page and a listview underneath it. Both widgets are placed inside a data view containing a parent context object. We have a button to select another month in the calender which triggers a MF to get the new data and refreshes the context object in client. This makes that both the calender widget as the listview show the new data. But this also makes the page to scroll automatically to the position of the listview. This is something I don’t want. I want the page stay focussed on the calender where the user selects the month. What triggers this scroll behaviour and how can I make sure this doesn’t occur when the user chooses another month?
asked
1 answers
1

Hi,

Add a container to the calendar and give a class name to the container and add the below javascript code to javascript widget.

$(function() {
var target = $('.classname of the container');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
});

 

answered