Hello Friends, In this post, I am going to present an example to set the default value in picklist (ui:inputSelect) in Lightning Component.
After completing this unit you’ll able to:
- Set default value of picklist lightning component.
Lightning Component:
<aura:component> <ui:inputSelect aura:Id="ddlPick" multiple="false" label="Select Color"> <ui:inputSelectOption label="Red" text="Red" value="true"/> <ui:inputSelectOption label="Green" text="Green"/> <ui:inputSelectOption label="Yellow" text="Yellow"/> <ui:inputSelectOption label="Black" text="Black"/> <ui:inputSelectOption label="Blue" text="Blue"/> </ui:inputSelect> </aura:component>
In the above example, when you set value property of <ui:inputSelectOption> is true, It become the default selected value of <ui:inputSelect> lightning component.
See also:
Conclusion:
Hope you like this post, Please comment for any question or suggestion.
Thank you!
See also:
Conclusion:
Hope you like this post, Please comment for any question or suggestion.
Thank you!
0 Comments
Post a Comment