hi there.
If I test this code, still nothing happens. i can click the button, but there is no filter.
Dataset name: FAQdataset.
My tagbuttons id:
first one: #UserTags
second one: #catTags
fliedkeys:
first one: userType
second one: category
Ps. it’s not that you need to activate some event handles on the right side?
$w.onReady(function () {
$w('#UserTags').onChange(event => {
let value = event.target.value;
if(value.length){
value = value.reverse()[0];//here you keep only the value f the last selection.
$w('#UserTags').value = [value];
//here you update the selection tags value
}
//then run the filter with the value by calling the runFilter() function
})
function runFilter(){
let filter = wixData.filter();
const userType = $w('#UserTags').value;
if(userType.length){
filter = filter.eq('userType', userType[0]);
}
const cat = $w('#catTags').value;
if(cat.length){
filter = filter.hasSome('category', cat )
}
$w('#FAQdataset').setFilter(filter);
}})