Real Estate Filter

Hello guys, how are you?
Sorry for being bothering you.
I would like to know if someone can help me.
I need to create a Real Estate filter for my website, filtering the state, city, neighborhood, price, number of bedrooms, number of bathrooms and the type of house.
But those filter have to be conditional filters for dropdowns.
Can someone help me?
This is how it’s now.
The code:
import wixData from “wix-data”

export function button13_dblClick(event) {
// initialise filter
let filter = wixData.filter();
// get dropdown value
let termo1 = $w( “#distritodropdown” ).value;
let termo2 = $w( “#conselhodropdown” ).value;
let termo3 = $w( “#freguesiadropdown” ).value;
// test each value and if it is set then append a filter
if (termo1) {
// add distrito filter
filter = filter.eq( “distrito” , termo1);
if (termo2) {
// append conselho filter
filter = filter.eq( “conselho” , termo2);
if (termo3) {
// append freguesia filter
filter = filter.eq( “freguesia” , termo3);
// reset dataset filter
$w( “#dataset1” ).setFilter(filter);

And the setting of my dropdowns is in the video I posted here.
if you want to access that page:

The keywords in my dataser is the same as it is in the filter:
Distrito, conselho, freguesia.
I aprecciate one more time for your help.
This is my website link if you want to access:
https:// www.saltini-re. com/c%C3%B3pia-search-all
I broke the URL so then the plataform allows me to post it.
13 comentários



To take a look how your filter could look like open this link…

Go to …

Setup one of the given Database-Presets to your own needs.
All possible given EXAMPLE-DATABASES you will find, when you click on “DATABASES”-button, on the very top of the page.

You will find a predefined —> “Real-Estate”-database which you can use as an interactive example-preview.

Go to Settings as shown above and navigate to —> “Presets”.
Chose one of the 4 given Presets-Options and setup your wished “Real-Estate”-database. All given example “reference-fields” you will find here …

After you have setted-up one of the DB-presets, you can try out the functions.

Read the original post, to learn the first step-coding of this working example.

If you have questions, just ask.:wink:

1 Like