Hi Amanda (the Amazing),
Thanks so much for your reply.
While I was waiting for a reply I managed to get the tags working.
Here is the code:
import wixData from ‘wix-data’ ;
$w . onReady ( function () {
$w ( "#seasonTags, #liturgyTags, #sacramentsTags, #saintsSolemnitiesFeastDaysTags, #artist1Tags" ). onChange ( **function** () {
search ();
});
**function** search () {
**let** filter = wixData . filter ();
**let** seasIdx = $w ( "#seasonTags" ). selectedIndices ;
**let** litIdx = $w ( "#liturgyTags" ). selectedIndices ;
**let** sacIdx = $w ( "#sacramentsTags" ). selectedIndices ;
**let** saiIdx = $w ( "#saintsSolemnitiesFeastDaysTags" ). selectedIndices ;
**let** artIdx = $w ( "#artist1Tags" ). selectedIndices ;
**let** seasVal = $w ( "#seasonTags" ). value ;
**let** litVal = $w ( "#liturgyTags" ). value ;
**let** sacVal = $w ( "#sacramentsTags" ). value ;
**let** saiVal = $w ( "#saintsSolemnitiesFeastDaysTags" ). value ;
**let** artVal = $w ( "#artist1Tags" ). value ;
**if** ( seasIdx . length > 0 || litIdx . length > 0 || sacIdx . length > 0 || saiIdx . length > 0 || artIdx . length > 0 ) {
filter = filter . hasAll ( "season" , seasVal )
. and ( filter = filter . hasAll ( "liturgy" , litVal ))
. and ( filter = filter . hasAll ( "sacraments" , sacVal ))
. and ( filter = filter . hasAll ( "saintsSolemnitiesFeastDays" , saiVal ))
. and ( filter = filter . hasSome ( "artist1" , artVal ))
$w ( "#dataset1" ). setFilter ( filter )
. then ( count )
} **else** {
$w ( "#dataset1" ). setFilter ( filter )
. then ( count )
}
$w ( "#resetfilter" ). onClick ( **function** () {
$w ( "#seasonTags, #liturgyTags, #sacramentTags, saintsSolemnitiesFeastDaysTags, #artist1Tags" ). value = **undefined** ;
$w ( "#dataset1" ). setFilter ( wixData . filter ()). then ( count );
});
}
//COUNT ITEM
**function** count () {
**let** count = $w ( "#dataset1" ). getTotalCount ();
**if** ( count > 0 ) {
$w ( "#countText" ). text = ` ${ count } items found` ;
} **else** { $w ( "#countText" ). text = `No item found` ; }
**return** count ;
}
$w ( "#dataset1" ). onReady ( **function** () {
count ();
});
});
Setting the repeater to blank is where I’m at. Please forgive my ignorance - I’m not sure what and where the code needs to go to set the repeater to empty. Please could you explain this to me. And I’ll keep looking into it in the meantime - maybe I’ll find it.
I’ve also added a search bar. Again, please, how do I code it to search the dataset and display results in the repeater.
Thank you for all you do and sharing your gift.
Peace,
Tim.