Hello everyone,
I’m fairly new at using Dev Mode. That said, I’m now stumped on trying to properly reset the drop down filters and the repeater. There is something in my code that I’m not doing correctly. Could you please take a look and let me know what it is that I might be doing wrong? I also have my button ID labeled as ‘resetButton’.
I appreciate anyone taking the time to help me out.
import wixData from ‘wix-data’ ;
//USE THIS LINE OF CODE FOR BUTTON ONCLICK
// export function searchButton_click_1(event) {
// search();
// }
$w . onReady (() => {
$w ( “#dropdown1, #dropdown2, #dropdown3” ). onChange ( function () {
search ();
});
});
function search () {
wixData . query ( "VenueOwnerRegistration1" )
. contains ( "country" , String ( $w ( "#dropdown1" ). value ))
. and ( wixData . query ( "VenueOwnerRegistration1" ). contains ( "stateProvinceRegion" , String ( $w ( "#dropdown2" ). value )))
. and ( wixData . query ( "VenueOwnerRegistration1" ). contains ( "affiliatedWith" , String ( $w ( "#dropdown3" ). value )))
//--------- COPY AND PASTE FROM THE .and() TO THE NEXT LINE TO ADD CODE FOR MORE DROPDOWN
. find ()
. then ( results => {
$w ( "#repeater7" ). data = results . items ;
});
}
export function resetButton_click ( event , $w ) {
$w ( “#dropdown1” ). value = undefined ;
$w ( “#dropdown2” ). value = undefined ;
$w ( “#dropdown3” ). value = undefined ;
$w ( “#repeater7” ). setFilter ( wixData . filter ());
}