I have a gallery that reads images from a dataset. The underlying collection has images, title, and a bunch of boolean fields that are used to filter the dataset. The dataset is unfiltered by default and the gallery displays the images as it should. My page displays a radio group that applies filters to the gallery by requiring the boolean value to be true. When I set a filter the gallery no longer displays anything - it’s as if nothing passes the filter. My code is
export function radioGroup1_change(event) {
setFilter($w("#radioGroup1").value);
}
function setFilter(value) {
let dbVal = dbFilters[validFilters.indexOf(value)]; // Converts UI value to DB field name
console.log("Setting filter to " + dbVal);
$w("#dataset1").setFilter(wixData.filter().eq(value, true));
}
Sample console output is:
Setting filter to isPT
and yes, isPT is one of the boolean fields in my collection. So what’s going wrong?