Hello,
first time poster, greetings to all!
Of course right away with a problem ;)
I have a repeater connected to a database and a pagination. On the live website everything works. I now want to change the page via velo (there are 3 pages). With the following code the currentpage is set to 2, but it still shows the first page:
$w("#dynamicDataset").onReady(() => {
$w("#pagination").currentPage = 2
});
If someone could help me, that would be great...
Greetings, Spectral
Hello Spectral,
Greetings to you too, and welcome to the community!
Regarding your issue with setting the current page for the repeater using Velo (formerly known as Corvid), there might be a reason why the page isn't changing as expected. The code you provided seems correct, so let's explore a few possibilities:
1. Pagination Configuration: Ensure that the pagination element ("#pagination") is properly connected to the repeater ("#dynamicDataset") and that the pagination is set up correctly with the appropriate settings (total number of pages, items per page, etc.).
2. Velo Execution Timing: Make sure the code is running at the appropriate time. If the repeater or pagination elements are dependent on data from a dynamic dataset, ensure that the code is executed after the dataset has loaded the data. If it's a static dataset, make sure the code runs when the repeater is fully rendered and ready.
3. Data Synchronization: Double-check that the data in the database is consistent with the pagination setup. If the number of items in the dataset changes or if there are any issues with data retrieval, it might affect the pagination behavior.
4. Custom Pagination: If you have implemented custom pagination logic, make sure that it doesn't interfere with the default behavior of the pagination element.
5. Page Index: Remember that the currentPage property is 1-based (not 0-based), so setting it to 2 should show the second page, not the first.
For further debugging, you can use the browser console (usually accessible by pressing F12) to check for any errors or logs when the page is loaded or when the code runs.
If the issue persists, providing more context or a code snippet of the pagination setup and relevant Velo code might help the community assist you better.
Best of luck with resolving the issue, and I hope you have a great experience with Velo and your Wix website! If you have any more questions or need further assistance, feel free to ask. Happy coding!
Securitas ePay