Hello,
I have included a “Load More” button so that a repeater can show additional records from a dataset. The repeater is set to show 9 records as default. The code below works but when the button is clicked the codes uploads a number of additional records < 9 (tipycally 7), even if the underlying dataset contains enough records. Would you have any views on why this might be?
Many thanks!
//LOADMORE BUTTON CODE → LOADS MORE ITEMS FROM DATASET WHEN BUTTON CLICKED
$w ( “#loadMoreButton” ). onClick (() => {
$w ( “#loadMoreButton” ). label = “” ;
$w ( “#preloader” ). show ();
if ( $w ( ‘#Flats’ ). getTotalCount () !== $w ( “#flatrepeater” ). data . length ) {
$w ( ‘#Flats’ ). loadMore (). then (() => {
$w ( “#loadMoreButton” ). label = “Load more ” ;
$w ( “#preloader” ). hide ();
})
} else {
$w ( “#loadMoreButton” ). label = “No more apartments” ;
$w ( “#preloader” ). hide ();
$w ( “#loadMoreButton” ). disable ();
}
})
// END