repeater filtering - dual buttons

Hi,

I’ve been trying to show all the projects I have been working on in the same page, but I also want to allow people to clic on buttons to activate and deactivate visible categories. here’s a screenshot to get the idea:

On this example we would see art related projects and movies related projects. (comic projets would be hidden)
My database has boolean fields for those categories, here the pic:


So far most of the things I’ve see answered on the forum don’t seem to work, I have no idea why, so I flushed out all I wrote so far (I am definitely not a coder) and trying to reach out, see if what you guys think about this, and maybe you can point in the right direction

thanks!
cheers.

Hello Nicolas

You can add a filter to you dataset based on the check boxes:
example code:

$w("#myDataset").setFilter(
wixData.filter("myCollection")
  .eq("checkBoxField1",$w('#checkbox1').checked)
  .or(
    wixData.filter("myCollection")
      .eq("checkBoxField2",$w('#checkbox2').checked)
  ) 
  .or(     
  wixData.filter("myCollection")       
  .eq("checkBoxField3",$w('#checkbox3').checked)   
  ) 
 )

Best
Massa