Hi!
I have read many other tickets on this, however, I can never understand any of it. I am looking to filter a repeater based on dropdowns.
Here is my code:
import wixData from 'wix-data';
$w.onReady(function () {
//TODO: write your page related code here...
});
export function dropdown2_change(event) { //This is too change the value of each choice in one dropdown to 1+, 2+, 3+, etc. It changes the value to 1-5, 2-5, 3-5 etc.
let max=5;
let min = $w("#dropdown2").value;
if(min === 1){
max;
}
if(min === 2){
max;
}
if(min === 3){
max;
}
if(min === 4){
max;
}
if(min === 5){
max;
}
console.log(min,'-', max)
}
export function dropdown3_change(event) { //This is too change the value of each choice in one dropdown to 1+, 2+, 3+, etc. It changes the value to 1-5, 2-5, 3-5 etc.
let max=5;
let max=5;
let min = $w("#dropdown3").value;
if(min === 1){
max;
}
if(min === 2){
max;
}
if(min === 3){
max;
}
if(min === 4){
max;
}
if(min === 5){
max;
}
console.log(min,'-', max)
}
export async function button29_click(event, $w) { //This is too filter the reapeter when a user clicks button 29
$w("#dataset1").setFilter(wixData.filter()
.contains("containerDiscount", $w('#dropdown1').value)
.eq("enviroRating", Number($w('#dropdown2').value))
.eq("foodRating", Number($w('#dropdown3').value))
)
.then(() => {
console.log("Dataset is now filtered");
})
.catch((err) => {
console.log(err);
});
$w('#repeater1').expand();
}
However, it does not work in preview or on the live site. Here is the page: https://cqschool.wixsite.com/friendlyrestaurants/new-search
Here is the editor: https://editor.wix.com/html/editor/web/renderer/edit/d843891e-6ada-4570-b772-5af9f3914b1f?metaSiteId=432d1c3b-2287-44ae-8840-294c5fd2ec7d&editorSessionId=ca149d0d-8234-4023-b9f8-17d9bb42db17
Can anyone tell me what I am doing wrong?
Thanks in advance,
Alex