Hi!
I want to have several checkboxes that work together that is they show the result that is a combination of them. So I have a category for clothes, size and colour and according to selection they will show the ones that fit exactly the categories I have selected.
I haven't been able to reach this with the code I found. When I hit preview it doesn't even let me select anything.
Do I need to create another dataset?
Can you provide some code?
import wixData from 'wix-data'; const databaseName = 'Items1'; const databaseField = 'instrument'; $w.onReady(function () { $w('#checkboxGroup1').onChange((event) => { const selectedBox = $w('#checkboxGroup1').value; addItemstoRepeater(selectedBox); }) }); function addItemstoRepeater(selectedOption = []) { let dataQuery = wixData.query(databaseName); if (selectedOption.length > 0) { dataQuery = dataQuery.hasSome(databaseField, selectedOption); } dataQuery .find() .then(results => { const filtereditemsReady = results.items; $w('#listRepeater').data = filtereditemsReady; }) }
First, you could copy and paste the code here, so we can take a look.
It is quite feasible, I guess you need a filter with checkboxes...