Page 1 of 1

Pagein Problem

Posted: Thu Apr 10, 2014 2:59 am
by David Lim

http://docs.appery.io/tutorials/build...
Hi , I triying to set the limit of page to 1 but the next button is unable to work.


Pagein Problem

Posted: Thu Apr 10, 2014 3:11 am
by David Lim

Previous Button Javascript Code
var skip = parseInt(localStorage.getItem('skip'));
var limit = parseInt(localStorage.getItem('limit'));
var total = parseInt(localStorage.getItem('total'));
if (limit + skip 0){
localStorage.setItem('skip', skip-limit);
get_states.execute({});
if (skip - limit == 0){
Appery('buttonPrevious').hide();
}
if (skip - limit < total - limit ) {
Appery('buttonPrevious').show();
}
}


Pagein Problem

Posted: Thu Apr 10, 2014 3:12 am
by David Lim

Next button Javascript Code
var skip = parseInt(localStorage.getItem('skip'));
var limit = parseInt(localStorage.getItem('limit'));
var total = parseInt(localStorage.getItem('total'));

if (limit + skip < total){
localStorage.setItem('skip', limit+skip);
get_text.execute({});
}
if (limit + skip == limit) {
Appery('buttonPrevious').show();
}
if (limit + skip == total - limit) {
Appery('buttonNext').hide();
}


Pagein Problem

Posted: Thu Apr 10, 2014 4:15 am
by Alena Prykhodko

Hi David,

oN Previous button you use:

pre
get_states&#46;execute({});
/pre

But in Next button you are using:

pre

get_text&#46;execute({});
/pre

Please check it out and edit with right datasource name.


Pagein Problem

Posted: Thu Apr 10, 2014 6:24 am
by David Lim

Sorry to trouble you again, I want to redirect to another page in javascript but i not sure how.. can you help me on this?


Pagein Problem

Posted: Thu Apr 10, 2014 12:55 pm
by Maryna Brodina