Good morning, I am learning how to work on wix for a school project and i have a database with 148 rows.
The database contains name(key), image, nickname and description. The database is being all loaded onto a single page through a repeater but 148 images in a single page makes it to slow to open.
How do i make to separate it just like when you search on google, you have page 1 2 3 4.... This has to work with a search bar.
The repeater alredy is connected to the database and the search bar code is the following:
import wixData from "wix-data";
let lastFilterTitle;
let debounceTimer;
export function input1_keyPress(event, $w) {
if (debounceTimer) {
clearTimeout(debounceTimer);
debounceTimer = undefined;
}
debounceTimer = setTimeout(() => {
filter($w('#input1').value, lastFilterTitle);
}, 200);
}
function filter(title) {
if (lastFilterTitle !== title) {
let newFilter = wixData.filter();
if (title)
newFilter = newFilter.contains('title', title);
$w('#dataset1').setFilter(newFilter);
lastFilterTitle = title;
}
}