I am trying to pass a list of pick list values dynamically to lightning-combobox , but the values are not rendering in the list. Below is the sample code i am writing.
JS Code:
@track EmpList= [{ label: "Emp1", value: "EMP1Code"},{ label: "Emp2", value: "EMP2Code"}];
HTML Code:
<template if:true={EmpList}>
<lightning-combobox label="Select an Employee"
name="del_emp" class="del_emp"
placeholder="Select an Employee"
options={EmpList}
value={value}
>
</lightning-combobox>
</template>
The picklist is coming on UI, but the values are not available to select, is there something wrong i am doing?
-- As Rahul mentioned i have updated the options and it's working well, but when i try to add additional picklist values using JS function Combobox Is not reflecting the newly added ones.
JS Code:
this.AddressList.push({ label: "Emp3", value: "EMP3Code"});
Before above code ran below is the console.log output
[{"label":"Emp1","value":"EMP1Code"},{"label":"Emp2","value":"EMP2Code"}]
After adding the value below is the console.log output
[{"label":"Emp1","value":"EMP1Code"},{"label":"Emp2","value":"EMP2Code"},{"label":"Emp3","value":"EMP3Code"}]
Even though the values are coming in the console.log the picklist is not reflecting the latest added values.