Heya! I am playing around with Crayons to match our product UI for an app which I am building and I tried adding an id for each of the fw-select option, but it doesn’t seem to get reflected when the HTML gets rendered. I am also unable to add a class name as well for the same.
Code Snippet:
let multiSelect = `<fw-select id = 'options' multiple>`;
for (let i = 0; i < options.length; i++){
if (['requester', 'agent'].includes(options[i].name)){
continue;
}
if (!(options[i].default_field)){
options[i].name += '_cf';
}
multiSelect += `<fw-select-option class="option${i}" id="${i}" value="${options[i].name}"> ${options[i].label} </fw-select-option>`
}
$('.selectOptions').append(multiSelect);
HTML rendering:
And also there isn’t any method to get the text value of that particular option, so i’ve used a work-around by adding it to the value using the delimiter(’|’). So if there is any way to access the text, do let me know about that as well.
Thank you in advance :))