Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <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>
Add Comment
Please, Sign In to add comment