Hi there,
I have a page with a collection of database. I also added the events next and previous. However, these events work until the first and last fields. Is it possible to make an endless loop? When I reached the end of the database, would I go to the first field?
I didn’t find the answer to my question.
Hey
Then you will have to code and check if you are on the last record then you will have to move to the first and the reverse the other way.
Hi Andreas, thanks!
I found a partial solution. But I don’t really like that I wrote the title.
I can’t understand how to get the last field in database.
export function buttonNext_click(event, $w) {
$w("#dataset1").onReady(()=>{
let getItem = $w("#dataset1").getCurrentItem();
if(getItem.title === "COMFORT AHEAD OF THE PRESENT"){
$w("#dataset1").setCurrentItemIndex(0);
}
else {
$w('#dataset1').next();
}
});
}