Hi!
I would like to add the option to reset the informations in a data filters, to let the costumers go back from start with the research.
Let me explain, we have this web site
https://www.homepluscasa.com/listaimmobili
in this page you can search for a house, based on location and price.
But i need to add on datafilters value an option like: for location " everywere"
How could I fix this in dataset?
The code is following :
import {wixData} from 'wix-data';
export function button24_click_1(event, $w) {
$w("#dynamicDataset").setFilter(wixData.filter()
.contains(("citta", $w('#dropdown1').value)
.contains("tipologia", $w('#dropdown5').value)
.between("prezzo",parseFloat($w('#dropdown2').value), parseFloat($w('#dropdown4').value)))
.then((results)=> {
console.log("Dataset is now filtered");
$w("#repeater2").data = results.items;
}).catch((err)=> {
console.log(err);
});
$w("#repeater2").expand();
}
Let me say that in this part :
console.log(err);
}); ( HERE IS WRITTEN NOW, UNEXPECTED TOKEN ( BUT FEW DAYS AGO WAS OK )
$w("#repeater2").expand();
}
THANKS
Hi.
You can add an 'All' option to your dropdown by adding the following code inside the onReady function:
$w("#dropdown").options = $w("#dropdown").options.unshift({"label": "All", "value": "all"}); Alternatively, you can create a separate filter function so that you can manage your filters more easily. See this forum post for example.
Good luck!