Wow !! Yes !! It was so simple ^^… Thank you so much Russian-dima ! It works… slow, but it works ![]()
For those who are interested, here is the complete code working properly :
import wixData from ‘wix-data’ ;
$w.onReady( function () {
filterView();
$w( “#checkboxGroup1” ).onChange( (event, $w) => {
filterView();
});
});
function filterView(){
var categoriesFilter = $w( “#checkboxGroup1” ).value
console.log( ‘categories’ ,categoriesFilter);
$w( “#publications” ).setFilter(wixData.filter()
.hasSome( “categories” ,categoriesFilter)
)
.then( () => {
let count = $w( “#publications” ).getTotalCount();
if (count === 0 ){
$w( “#publications” ).setFilter(wixData.filter());
}
} )
. catch ( (err) => {
console.log(err);
} );
}