(Solved) Create an "All" filter on Editor X

Hello,

So I know it’s been discussed a lot and there are answers online : I simply want to filter my repeater through a dropdown and add an “All” option that displays everything. As I’ve made this lately on regular Wix, I’ve just pasted my code on my Editor X website. But the “All” option just doesn’t display anything, it erases all the results. Otherwise, every options works and it filters the repeater properly.

Note that I’ve set my dropdown in order to display the first result, that is to say “All” so when landing on the page, there is absolutely nothing.

Here’s what I’ve made :
→ Manually added every choices to match my database (I could have connected the dropdown to my dataset but it would have made duplicates and the tutorials I’ve found to get through this problem couldn’t work… And it’s quite urgent so I couldn’t any more time on this)
→ Added a filter option on my dataset (The field I’m interested by, “category” is user input, aka dropdown")

Here’s my code

import wixData from ‘wix-data’ ;

export function dropdown1_change(event){
let filterType = $w( ‘#dropdown1’ ).value;
if (filterType === “Tout” ){
$w( ‘#dataset1’ ).setFilter(wixData.filter());
} else {
$w( ‘#dataset1’ ).setFilter(wixData.filter().contains( “catgorie” , filterType));
}
}
I’ve checked the code :
→ The #dropdown1 and #dataset1 matches my page
→ “Tout” (meaning “All” in French as it’s my native language) is both the value and label of my dropdown choice
→"catgorie" is the key of the section I’m trying to filter (in french it’s “Catégorie” but accents don’t work in keys so it erases the “é”)

Is there anything I might have missed somehow?

Thank you.

Up. Still can’t figure how to fix my issue and I don’t know why this exact code works on regular Wix editor but not on Editor X :frowning:

Chek the dropdown property panel and make sure the onChange is toggled there.

@jonatandor35 Oh, thank you, it was simple as that!

I thought that the line “export function dropdown1_change” was enough.

Thank you!!!