top of page
Cuisine:
Location:
Cost:
16 items found

Gelato

Italian

$

50

Italy London Worldwide

Risotto

Italian

$

50

Italy London Worldwide

Bœuf bourguignon

French

$

50

Worldwide France Italy

Soupe à l’oignon

French

$

50

France London

Chips & Pastry

Italian

$

50

London Italy France

Yellow Cab

Italian

$

50

Worldwide Italy

Ravioli

Italian

$

50

London Worldwide Italy

Pizza

Italian

$

50

Italy London

Cassoulet

French

$

50

London France

Paris Spaghetti

French

$

50

London Worldwide

Potato House Diner

Italian

$

50

Worldwide France London

Lasagna

Italian

$

50

Worldwide London France

Chocolate soufflé

French

$

50

France Worldwide

Coq au vin

French

$

50

France London Italy

Rolled & Scrambled Eggs

French

$

50

Worldwide London France

The Roasted Chicken

French

$

50

London France Worldwide

import wixData from 'wix-data';

$w.onReady(function () {

 

    $w("#cuisineTags, #locationTags, #costTags").onChange(function () {

        search();

    });

 

    function search() {

 

        let filter = wixData.filter();

 

        let cuisIdx = $w("#cuisineTags").selectedIndices;

        let locIdx = $w("#locationTags").selectedIndices;

        let costIdx = $w("#costTags").selectedIndices;

 

        let cuisVal = $w("#cuisineTags").value;

        let locVal = $w("#locationTags").value;

        let costVal = $w("#costTags").value;

 

        if (cuisIdx.length > 0 || locIdx.length > 0 || costIdx.length > 0) {

 

            filter = filter.hasAll("cuisine", cuisVal)

                .and(filter = filter.hasAll("location", locVal))

                .and(filter = filter.hasAll("cost", costVal))

 

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

                .then(count)

 

        } else {

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

                .then(count)

        }

 

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

            $w("#cuisineTags, #locationTags, #costTags").value = undefined;

            $w("#dataset1").setFilter(wixData.filter()).then(count);

        });

 

    }

 

    //COUNT ITEM

    function count() {

        let count = $w("#dataset1").getTotalCount();

        if (count > 0) {

            $w("#countText").text = `${count} items found`;

        } else { $w("#countText").text = `No item found`; }

 

        return count;

    }

 

    $w("#dataset1").onReady(function () {

        count();

    });

});

Copied!

bottom of page