0

<lightning:combobox aura:id="filterCaseType" label = "{!$Label.c.CPL_Event_Type}" name="caseTypes" placeholder="Case Type" options="{!v.caseEventTypeOptions }" onchange="{!c.filterCasesByType }"/>

caseEventTypeOptions --> Is list of Key value pair

now values are Sunday, Monday, Tuesday, Wednesday.....Saturday.

Now when page loads i want Tuesday to be selected by default. How can i achieve this in aura:lightning cmp on java script side.

0

You have to make use of the value attribute.

Check the below code

<lightning:combobox 
            name="Fruit" 
            label = "Select a Fruit" 
            value = "{! v.defaultVal }"
            placeholder = "Select Progress"
            options="{! v.options }" 
            onchange="{! c.handleChange }"/>

In the above code, defaultVal attribute holds the default value for the Combo Box.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.