On my real estate website ( https://www.dreamspotsrealestate.com/ ), I created a database of our rental properties. On the “Properties for Rent” page, I have a user input search bar that is working well with the code below:
let debounceTimer;
export function searchINPUT_keyPress(event) {
if (debounceTimer) {
clearTimeout(debounceTimer);
debounceTimer = undefined;
}
debounceTimer = setTimeout(() => {
filter($w('#searchINPUT').value);
}, 200);
}
let lastFilterTitle;
function filter(title) {
if (lastFilterTitle !== title) {
$w('#dataset1').setFilter(wixData.filter()
.contains('title', title));
lastFilterTitle = title;
}
}
In the dataset I created a boolean field (“offMarket”) to check off which properties were no longer available. I have been having troubles trying to code the user search to account for these off-market properties.
Does anyone have any suggestions or feedback??