Guest User

Untitled

a guest
Feb 17th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. <aura:component controller="CarTypeSearch"
  2. implements="force:appHostable,flexipage:availableForRecordHome,force:hasRecordId">
  3.  
  4. <!-- Attribute to controle visibility of New button -->
  5. <aura:attribute name="showNew" type="boolean" />
  6. <aura:attribute name="carTypes" type="Car_Type__c[]"/>
  7.  
  8. <aura:handler name="init" action="{!c.doInit}" value="{!this}"/>
  9.  
  10. <!-- This event will be fired when user will click on
  11. search button and will selected carTypeId-->
  12. <aura:registerEvent name="searchFormSubmit" type="c:SearchFormSubmitEvent" />
  13.  
  14. <lightning:layout horizontalAlign="center">
  15. <lightning:layoutItem>
  16. <lightning:select name='selectItem' aura:id="carType" label='All Types'
  17. variant="label-hidden" value="">
  18. <option value="" text="All Types" />
  19. <aura:iteration items="{!v.carTypes}" var="carType">
  20. <option value="{!carType.Id}" text="{!carType.Name}" />
  21. </aura:iteration>
  22. </lightning:select>
  23. </lightning:layoutItem>
  24.  
  25. <lightning:layoutItem padding="around-medium">
  26. <lightning:button label="Search" variant="brand" onclick="{!c.onFormSubmit}"/>
  27. <!-- display new button on availibity -->
  28. <aura:if isTrue="{!v.showNew}">
  29. <lightning:button variant='neutral' label='New' onclick="{!c.createRecord}"/>
  30. </aura:if>
  31. </lightning:layoutItem>
  32. </lightning:layout>
  33. </aura:component>
Add Comment
Please, Sign In to add comment