David Lim
Posts: 0
Joined: Wed Mar 12, 2014 3:58 am

Pagein Problem

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.

David Lim
Posts: 0
Joined: Wed Mar 12, 2014 3:58 am

Pagein Problem

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();
}
}

David Lim
Posts: 0
Joined: Wed Mar 12, 2014 3:58 am

Pagein Problem

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();
}

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Pagein Problem

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.

David Lim
Posts: 0
Joined: Wed Mar 12, 2014 3:58 am

Pagein Problem

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?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Pagein Problem

Return to “Issues”