top of page
Image
Title
Price
Location
Paris Spaghetti
50
London
Rolled & Scrambled Eggs
60
Worldwide
Chips & Pastry
70
London
Potato House Diner
80
Worldwide
The Roasted Chicken
90
London
Yellow Cab
100
Worldwide

import wixData from 'wix-data';

 

$w.onReady(function () {

 

    $w('#locationDropdown').onChange(() => {

 

        const selectedVal = $w('#locationDropdown').value;

 

        let filter = wixData.filter();

 

        if (selectedVal.length > 0) {

            filter = filter.hasSome("location", selectedVal);

        }

 

        $w('#dataset1').setFilter(filter);

 

    });

 

    $w("#clearFilter").onClick(function () {

 

        $w("#dataset1").setFilter(wixData.filter())

 

        $w("#locationDropdown").value = undefined

 

    })

});

Copied!

bottom of page