Dropdown options for the lightning combobox are not getting displayed on UI. All values are getting fetched through the standard method getPicklistValuesByRecordType in the Js file of LWC component.
kindly assist me, where and what did I miss in the below snippet: Code for the the UI LWC htmlfile
<lightning-tabset class="slds-tabs_small">
<template for:each={tabList} for:item="tab">
<lightning-tab label={tab.label} key={tab.Index} value={tab.Index} style="margin: 0.5rem;">
<lightning-combobox
label="Field"
options={options}
required="true">
</lightning-combobox>
</lightning-tab>
</template>
</lightning-tabset>
Handling to display the picklist field values JS file
import { LightningElement,track,wire } from 'lwc';
import { getPicklistValuesByRecordType } from 'lightning/uiObjectInfoApi';
export default class Test extends LightningElement {
@track tabList = [];
connectedCallback()
{
console.log('inside getTabs');
this.tabList.push(
{
Index: 0,
label: 1 + 'Tab',
TabName: '1st Tab',
TabNo:1+'st Tab',
},
{
Index: 1,
label: 2 + 'Tab',
TabName: '2nd Tab',
TabNo:2+'nd Tab',
},
)
}
@wire(getPicklistValuesByRecordType, { objectApiName: TURBODISP_OBJECT, recordTypeId:'recordtypIdPassedhere' })
fetchPicklist({error,data})
{
if(data && data.picklistFieldValues)
{
data.picklistFieldValues["Field1__c"].values.forEach(optionData => {
this.options.push({label : optionData.label, value : optionData.value});
});
console.log('values[]'+ JSON.stringify(this.options));
}
}
}
Expecting dropdown values on UI