Hey,
I really need some help sorting this out.
I've created a repeater that is connected to a dataset. This result is filtert using a selectionTag. There are 4 "tags", but on page load I would like to see the first tag and not the entire database. See my code below. Thanks in advance.
import wixData from 'wix-data'; const collectionName = 'InfoLessen'; const fieldToFilterByInCollection = 'doelTraining'; $w.onReady(function () { setRepeatedItemsInRepeater(); loadDataToRepeater(); $w('#dropdown1').onChange((event) => { const selectedTags = $w('#selectionTags1').value; loadDataToRepeater(selectedTags); }) }); function loadDataToRepeater(selectedCategories = []) { let dataQuery = wixData.query(collectionName); if (selectedCategories.length > 0) { dataQuery = dataQuery.hasAll(fieldToFilterByInCollection, selectedCategories); } dataQuery .find() .then(results => { const itemsReadyForRepeater = results.items; $w('#repeater1').data = itemsReadyForRepeater; const isRepeaterEmpty = itemsReadyForRepeater.length === 0 }) } function setRepeatedItemsInRepeater() { $w('#repeater1').onItemReady(($item, itemData) => { $item('#text79').text =itemData.title; $item('#text6').src = itemData.image; $item('#image23').src = itemData.afbeelding; }) }