Created
January 15, 2018 21:32
-
-
Save msrivastav13/6cf3a89c9293e72cc2463f1b02a414a9 to your computer and use it in GitHub Desktop.
searchAppV2
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:application extends="force:slds"> | |
<c:searchCmp /> | |
</aura:application> |
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 implements="force:appHostable,flexipage:availableForAllPageTypes" access="global" > | |
<aura:attribute name="searchTerm" type="String" /> | |
<lightning:layout multipleRows="true" horizontalAlign="center" verticalAlign="center"> | |
<lightning:layoutItem flexibility="auto" size="6"> | |
<lightning:input type="search" aura:id="searchBox" label="Search" name="search" placeholder="Enter Search Term" value="{!v.searchTerm}"/> | |
</lightning:layoutItem> | |
<lightning:layoutItem flexibility="auto" size="4" padding="horizontal-small"> | |
<lightning:button variant="brand" label="Search" title="" onclick="{! c.handleClick }" /> | |
</lightning:layoutItem> | |
<lightning:layoutItem flexibility="auto" padding="around-large" size="6"> | |
<p> You searched for {!v.searchTerm}</p> | |
</lightning:layoutItem> | |
</lightning:layout> | |
</aura:component> |
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
({ | |
handleClick : function(component, event, helper) { | |
helper.setSearchTerm(component, event); | |
} | |
}) |
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
({ | |
setSearchTerm : function(component, event) { | |
var searchTerm = component.get("v.searchTerm"); | |
console.log(searchTerm); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment