Hello,
i had copied the code given in the next/previous buttons for dynamic pages and index page
but unfortunately it did not work
thus can anybody direct me in how to use it
page link
https://www.hvcoman.com/genCat/SPECIALIZED-NURSING-CARE
Hello,
i had copied the code given in the next/previous buttons for dynamic pages and index page
but unfortunately it did not work
thus can anybody direct me in how to use it
page link
https://www.hvcoman.com/genCat/SPECIALIZED-NURSING-CARE
Hey,
We have a newly released API just for that.
You can use it in your page like that (and make sure to disconnect your buttons from their current connection):
$w.onReady(function () {
// TODO: write your page related code here...
$w('#next').onClick(() => {
$w('#dynamicDataset').getNextDynamicPage().then(url => {
wixLocation.to(url);
});
});
$w('#previous').onClick(() => {
$w('#dynamicDataset').getPreviousDynamicPage().then(url => {
wixLocation.to(url);
});
});
});
Also, in the near future we hope to allow doing that without any code, so stay tuned!
Good luck,
Itai
worked !!
thank you very much Itai
Dear Itai,
there is one issue i had found in the code, once it goes to the last item in the data set the next button does not work and it does not go disabled
should there be an if loop for checking last item.
or if possible let it restart from first again !