Hello,
I’ve created searching model using filtering of data base, input and code.
However, my input (text box) is on the same page where the results (repeater model with filtering) appear.
I want to place my search bar in the header so every time someone click on the button next to the input it will send him to the search page and place the text he tried looking for in the header inside the input area of the results page.
(i’m doing it because the basic search function is not working very well with my data)
Thank you very much!
My data filtering code for reference:
let debounceTimer;
export function iTitle_keyPress(event, $w) {
if (debounceTimer) {
clearTimeout(debounceTimer);
debounceTimer = undefined;
}
debounceTimer = setTimeout(() => {
filter($w("#iTitle").value);
},200);
}
let lastFilterTitle;
function filter(title){
$w("#text14").hide();
if(lastFilterTitle !== title) {
$w('#dataset1').setFilter(wixData.filter().contains('name', title)).
then((results) => {
$w("#dataset1").getTotalCount() > 0 ? $w("#repeater1").data = results.items : $w("#text14").show();
})
lastFilterTitle = title;
}
}