I am building a real estate website for TMT Realty ( https://bdarienjr.wixsite.com/tmt-realty ) and I am having problems with my code on the Properties For Rent page ( https://bdarienjr.wixsite.com/tmt-realty/rentals-1 ).
I have a dataset of properties/units available for rent (see below).
My code currently works for filtering by price, # beds/baths, and neighborhood. However, my code is failing to account for the units checked as “offMarket” - Looking at my page’s code below, can anyone tell where I am going wrong??
import wixData from 'wix-data';
$w.onReady(function () {
});
let lastFilterTitle;
function filter(title) {
if (lastFilterTitle !== title) {
$w('#dynamicDataset').setFilter(wixData.filter()
.ne('offMarket', true)
.contains('title', title));
lastFilterTitle = title;
}
}
export function searchButton1_click_1(event) {
$w("#dynamicDataset").setFilter(wixData.filter()
.contains("sortNeighborhood", $w("#hoodsDD").value)
.ge("beds", Number($w("#bedsDD").value))
.ge("baths", Number($w("#bathsDD").value))
.le("sortRent", Number($w("#priceSlider1").value))
);
}