I am trying to display tags from my database as tags in my repeater. The Field key of the tags I want to display is operatorTypes.
I've pasted my code into the page console like so:
// For full API documentation, including code examples, visit https://wix.to/94BuAAs
$w.onReady(function () {
//TODO: write your page related code here...
export function repeater2_itemReady($item, operatorTypes, index) {
let tags = operatorTypes.tags;
let tagsHtml = tags.map(tag =>
`<span style="background: #459fed;
border-radius: 5px;
padding: 0 3px;
color: #fff;
font-size: 12px">${tag}</span>`)
.join(' ');
$item('#tags').html = tagsHtml;
}
});
See attached for what I'm trying to achieve:
Hi guys, this worked for me with the selection tags user input element. example: https://hatlelukas.wixsite.com/mysite/repeater
exportfunction repeater1_itemReady($item, itemData, index) { //get tags from db for an item let tags = itemData.tags; //prepeate hashmap with tags to be diplayed for (var i = 0; i < tags.length; i++) { options.push({"label": tags[i], "value": tags[i]}); } //Set tags UI component $item("#selectionTags1").options = options; }