repeater doesnt display on filter search

Database with values doesn’t show up on search

Website is https://bit.ly/3kpFbvn

Whenever any option is selected the repeater disappears but the console log shows the dataset is filtered. No error there. Wondering what simple thing I am doing wrong.

// For full API documentation, including code examples, visit https://wix.to/94BuAAs

import wixData from 'wix-data';

$w.onReady(function () {
 // TODO: write your page related code here...

});

export async function button1_click_1(event, $w) {
    $w("#dataset1").setFilter(wixData.filter()
            .contains("bikeType", $w('#dropdown1').value)
            .ge("engineCC", Number($w('#dropdown2').value))
        )
        .then(() => {
            console.log("Dataset is now filtered");
        })
        .catch((err) => {
            console.log(err);
        });
 
    $w('#repeater1').expand();
}

export function button2_click(event) {
 
$w("#dataset1").setFilter(wixData.filter());
$w('#dropdown1').resetValidityIndication();
$w('#dropdown2').resetValidityIndication();
$w('#dropdown3').resetValidityIndication();

$w("#dropdown1").selectedIndex = undefined;
$w('#dropdown2').selectedIndex = undefined;

}

Snapshot of collection below.

I’m sure someone out here has the answer. TIA.

Hey Jaosh, how are you?

One thing I see is that the repeater expand should be inside of the .then():

        .then(() => {
            console.log("Dataset is now filtered");
            $w('#repeater1').expand();
        })

To be honest, I can’t see that that’s your problem, but it is an issue. Including expand in the then ensures that the repeater will expand when the dataset is filtered.

It doesn’t seem correct to set the dropdown value to undefined. Seems to me it should be set to null, or maybe 0 depending on your options.

I also see that one of the bike types is “- BMW”. Do you really want the hyphen? Or should it be just “BMW”?

Just spotted something…

You have this:

.ge("engineCC", Number($w('#dropdown2').value))

Should be this:

.ge("engineCc", Number($w('#dropdown2').value))

I hope this helps, 'cause I ran out of ideas.

Grrr knew it was a silly error! Was an issue with the “engineCc” typo. Thanks again boss. This was your code from a previous article too. Pls mark as closed.