Joe Sharples
Posts: 0
Joined: Mon Aug 18, 2014 1:31 pm

scroll to bottom of list

I have a service with 'limit' and 'skip' parameters that pushes the response to an array, which is then set to local storage and then mapped to a list.

I have a 'load more' button that increases the skip and invokes the service again.
the result is a list that keeps extending when the user clicks 'load more.

This all works well except after the service is called and the results mapped the page jumps to the top of the list.

what code can i use to scroll to the bottom of the page?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

scroll to bottom of list

Hello Joe,

You have to change parameter "skip" in every next run. Please look this tutorial: https://blog.appery.io/2015/07/how-to...

Joe Sharples
Posts: 0
Joined: Mon Aug 18, 2014 1:31 pm

scroll to bottom of list

Thanks Sergiy,

I've followed the tutorial but i'm having a problem.
Using dev tools i can see that the service on page show has blank values for limit and skip.

I use the code in the documentation on page show to set the storage variable:
pre
var infiniteList = {limit: "12", skip: "0", noMoreItems: undefined};
Apperyio.storage.profileInfinite.set(infiniteList);
jQuery( window ).scroll(onScrollHandler);

console.log("infiniteList:" + infiniteList);
var infinLSV = Apperyio.storage.profileInfinite.get();
console.log("infinLSV skip: "+ infinLSV.skip);
/pre

I set the model and storage up the same way as in the tutorial, but changing the name.
Image

Image

The storage variable after page show is 'object Object'.
Image

and here is the console.log from the page show event:
Image

Joe Sharples
Posts: 0
Joined: Mon Aug 18, 2014 1:31 pm

scroll to bottom of list

what am i doing wrong?

Joe Sharples
Posts: 0
Joined: Mon Aug 18, 2014 1:31 pm

scroll to bottom of list

I'm getting very close to my deadline for finishing version 1 of my app. Is there a piece of code i can use to force the page to scroll to the bottom? as a work around.

I will continue implementing your method after I have launched version 1, but just for now is there a way to make the page scroll to the bottom?

Thank you

Joe Sharples
Posts: 0
Joined: Mon Aug 18, 2014 1:31 pm

scroll to bottom of list

I have used
$.mobile.silentScroll();
as a work around for now to force the page to scroll

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

scroll to bottom of list

Thanks for the update, Joe!

Return to “Issues”