hey i found a simple solution for anyone who would need to paginate their list item view
i created a variable named it currentPage default value 1
const items = datasource.data
const itemsPerPage = 10;
const currentPageValue = currentPage.value;
const startIndex = (currentPageValue - 1) * itemsPerPage;
const endIndex = startIndex + itemsPerPage;
const paginatedItems = items.slice(startIndex, endIndex);
productsList.setValue(paginatedItems)
const totalPages = Math.ceil(items.length / itemsPerPage);
then i added two icons on my list view with events on click
- currentPage.setValue(currentPage.value + 1)
- currentPage.setValue(currentPage.value - 1)
you can also use buttons hope this helps someone