Hello.
This is my site : https://karalist2018.wixsite.com/listkara
On page “Liste des artistes”, my search bar works well
On page “Liste des titres”, my search bar don’t work… Why ?
The code is :
import wixdata from "wix-data";
let lastFilterTitle;
let debounceTimer;
export function iTitle_keyPress(event, $w) {
if (debounceTimer) {
clearTimeout(debounceTimer);
debounceTimer = undefined;
}
debounceTimer = setTimeout(() => {
filter($w('#iTitle').value); // input ID
}, 20);
}
function filter(title) {
if (lastFilterTitle !== title) {
wixdata.query("Titres") // name of your database
.limit(20)
.contains('title', title)
.find()
.then(res => {
$w('#repeater3').data = res.items; // repeater ID
})
.catch( (error) => {
let errorMsg = error.message;
let code = error.code;
} );
lastFilterTitle = title;
}
}
Where am I wrong ?
Sorry for my english, i’m french
Thanks for help.