I’m trying to set a repeater that takes data from a dataset. based on filtration from a dropdown.
Kindly I need a help me with my code it works for the selection “All”
but when choosing another value it doesn’t work.
import wixData from 'wix-data';
$w.onReady(function () {
//wixData.query("Electronics_Laptops");
});
export function dropdown1_change(event, $w) {
conditionFilteration($w("#dropdown1").value);
}
function conditionFilteration (condition) {
if (condition === "All") {
$w("#dataset1").setFilter(wixData.filter());
}
else {
$w("#dataset1").setFilter(wixData.filter().contains("Laptop_Condition", condition)); //database collection called "Electronics"
//and Filtered filed is "Laptop_Condition"
}
}
Thanks for helping me.
Kindly I’m a beginner.