Unable to load options in select dropdown dynamically

Hi Team,

I’m building an application in the ticket details page modal and trying to populate some dropdown fields from which I get the options from the API.
But the options parameter is not working and appending the options to the select. I’m using crayons v4 and trying to render in a modal in ticket details page

Modal.html

<fw-select id="billings" placeholder="Select your option" label="Verrechnung" required="true"></fw-select>

Modal.js

let billings = parsedResponse?.data?.map((obj) => ({ value: obj?._id, text: obj?.normal }));
var populateBilling = document.getElementById("billings");
populateBilling.options = billings;

Is there something I’m missing in this? Thanks in advance :slightly_smiling_face:

Hi @mohammed

I don’t think that has ever worked. I had to destroy and rebuild the select each time I wanted to change the options dynamically.

Hello @RobAtOpinyin

Thanks for your reply. I saw this issue and found out that it had been working. I’m not sure is it because of v4.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.