Created
February 15, 2019 19:26
-
-
Save choudharymanish8585/3e2ec651690a0ccf41dc7a00afe06c12 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component controller="CarTypeSearch" | |
implements="force:appHostable,flexipage:availableForRecordHome,force:hasRecordId"> | |
<!-- Attribute to controle visibility of New button --> | |
<aura:attribute name="showNew" type="boolean" /> | |
<aura:attribute name="carTypes" type="Car_Type__c[]"/> | |
<aura:handler name="init" action="{!c.doInit}" value="{!this}"/> | |
<!-- This event will be fired when user will click on | |
search button and will selected carTypeId--> | |
<aura:registerEvent name="searchFormSubmit" type="c:SearchFormSubmitEvent" /> | |
<lightning:layout horizontalAlign="center"> | |
<lightning:layoutItem> | |
<lightning:select name='selectItem' aura:id="carType" label='All Types' | |
variant="label-hidden" value=""> | |
<option value="" text="All Types" /> | |
<aura:iteration items="{!v.carTypes}" var="carType"> | |
<option value="{!carType.Id}" text="{!carType.Name}" /> | |
</aura:iteration> | |
</lightning:select> | |
</lightning:layoutItem> | |
<lightning:layoutItem padding="around-medium"> | |
<lightning:button label="Search" variant="brand" onclick="{!c.onFormSubmit}"/> | |
<!-- display new button on availibity --> | |
<aura:if isTrue="{!v.showNew}"> | |
<lightning:button variant='neutral' label='New' onclick="{!c.createRecord}"/> | |
</aura:if> | |
</lightning:layoutItem> | |
</lightning:layout> | |
</aura:component> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment