I am trying to code a simple filter to filter a repeater to specific values in a database.
I have a coding background but not worked with js that much and im continually learning. I followed a previous post about this but it simply wont work! I can filter the repeater down but when i want to show all reults using a ‘All’ selection in the drop down it doesnt work.
I dont want a clear button as i think this will ruin the whole look.
code below;
import wixData from ‘wix-data’;
export function dropdown1_change(event) {
//Add your code for this event here:
let myValue = $w(‘#dropdown1’).value;
console.log(myValue,“myvalue”)
if (myValue === ‘All’){
$w(‘#dataset1’).setFilter(wixData.filter);}
else {
$w(“#dataset1”).setFilter(wixData.filter().contains(‘style’, myValue));
}
}
thanks,
Louis.