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
Curtir
Comentar