Hello there.
I am beginner in wix programming. I am having problem with setting multiple filters.
I am building the hotel database in one repeater set on page and I need it to be filtered by:
- name (text input field),
- region and hotel category (two dropdowns)
- options in three checkboxes (discounts etc.)
And everything should work together unse search ("Szukaj") button.
When I put dropdowns to the code - it works. Or text field alone. But all together fails.
I based my code on this video:
This is my sub-site:
https://hqservices.wixsite.com/polhot/obiekty
![](https://static.wixstatic.com/media/a27d24_4354f428bce14be780104eeb82b27689~mv2.png/v1/fill/w_980,h_512,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/a27d24_4354f428bce14be780104eeb82b27689~mv2.png)
And that's the code for hotels website ("Obiekty"):
import wixData from 'wix-data';
export function button6_click(event, $w) {
$w("#dataset1").setFilter(wixData.filter()
.contains("region", $w('#dropdown1').value)
.eq("kategoryzacja", $w('#dropdown2').value)
.contains("title", $w('#input4').value)
.eq("znizka", $w('#checkbox1').checked)
.eq("wymianaVoucherowa", $w('#checkbox2').checked)
.eq("bonTurystyczny", $w('#checkbox3').checked))
.then((results) => {
console.log("Dataset is now filtered");
$w("#listRepeater").data = results.items;
}).catch((err) => {
console.log(err);
});
$w("#listRepeater").expand();
}
And one more info. On the end I get error message:
"TypeError: Cannot read property 'items' of undefined"
Even for those parts of code which works (dropdowns).
Apart from all above my site work horrible slow.
Let me know please what can I improve to make it work.
Thanks