function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sparky JaneSparky Jane 

lightning:select Not displaying values in drop down

Hey There,

I'm creating a lightning:select component dynamically from the JS and the component JSON is built perfectly like below:
 
["lightning:select", {
		"label": "Industry",
		"required": true,
		"value": {},
		"fieldPath": "Industry",
		"aura:id": "Industry",
		"options": [{
			"value": "--None--",
			"label": "--None--"
		}, {
			"value": "A",
			"label": "A"
		}, {
			"value": "B",
			"label": "B"
		}]
	}],

$A.createComponents(JSONString, function(cmps) {
            cmp.set('v.body', cmps);            
        });

The picklist got created as below. But with empty dropdown.

User-added image

Can some one please help with this.

Thanks in advance.
Raj VakatiRaj Vakati
try this 
     $A.createComponents(
        [
            [
                "lightning:select", { label: "Select List", name: "list1"}
            ],
            [
                "option", { value: "Option 1", label: "Option 1" }
            ],
            [
                "option", { value: "Option 2", label: "Option 2" }
            ]
        ],
Sparky JaneSparky Jane
Hi Raj,

I have options more than 56 values. Can you sugest with a sample code to ierate options from JS. Because, I need lightning:select to be created dynamically along with options from JS.

Thanks in advance