55 lines
3.3 KiB
Plaintext
55 lines
3.3 KiB
Plaintext
<aura:component controller="AddDeleteController" >
|
|
<!---Use Salesforce Lightning Design System CSS From Static resources-->
|
|
<!--<ltng:require styles="{!$Resource.SLDS24 + '/assets/styles/salesforce-lightning-design-system.css'}"/>-->
|
|
|
|
<!--declare attributes-->
|
|
<aura:attribute name="selectedRecord" type="Account" description="Use,for store SELECTED sObject Record"/>
|
|
<aura:attribute name="selectedRecordName" type="String" />
|
|
<aura:attribute name="listOfSearchRecords" type="Account[]" description="Use,for store the list of search records which returns from apex class"/>
|
|
<aura:attribute name="SearchKeyWord" type="string"/>
|
|
<aura:attribute name="Message" type="String" default="Search Result.."/>
|
|
<aura:method name="clear" action="{!c.clear}" />
|
|
<aura:method name="showError" action="{!c.showError}" />
|
|
<!--declare events hendlers-->
|
|
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
|
|
<aura:handler name="oSelectedAccountEvent" event="c:selectedAccountEvent" action="{!c.handleComponentEvent}"/>
|
|
<aura:handler event="aura:waiting" action="{!c.showSpinner}"/>
|
|
<aura:handler event="aura:doneWaiting" action="{!c.hideSpinner}"/>
|
|
|
|
<!-- https://www.lightningdesignsystem.com/components/lookups/ -->
|
|
<div class="slds-m-around--large">
|
|
<div aura:id="searchRes" class="slds-form-element slds-lookup slds-is-close" data-select="single">
|
|
<label class="slds-form-element__label" for="lookup-348"> Account Name </label>
|
|
<!--This part is for display search bar for lookup-->
|
|
<div class="slds-form-element__control">
|
|
<div class="slds-input-has-icon slds-input-has-icon--right">
|
|
|
|
<div aura:id="lookup-pill" class="slds-pill-container slds-hide">
|
|
<span class="slds-pill" style="width: 100%;">
|
|
<span class="slds-pill__label">
|
|
{!v.selectedRecord.Name}
|
|
</span>
|
|
<button class="slds-button slds-button--icon slds-pill__remove" onclick="{!c.clear}">
|
|
<span>x</span>
|
|
<span class="slds-assistive-text">Remove</span>
|
|
</button>
|
|
</span>
|
|
</div>
|
|
<div aura:id="lookupField" class="slds-show">
|
|
<ui:inputText aura:id = "lookupfield" required = 'true' updateOn="keyup" keyup="{!c.keyPressController}" class="slds-lookup__search-input slds-input " value="{!v.SearchKeyWord}" placeholder="search.."/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!--This part is for Display typehead lookup result List-->
|
|
<div class="slds-lookup__menu slds" id="lookup-348">
|
|
<div class="slds-lookup__item--label slds-text-body--small">{!v.Message}</div>
|
|
<center> <ui:spinner aura:id="spinner"/> </center>
|
|
<ul class="slds-lookup__list" role="listbox">
|
|
<aura:iteration items="{!v.listOfSearchRecords}" var="singleRec">
|
|
<c:customLookupResult oAccount="{!singleRec}" />
|
|
</aura:iteration>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</aura:component> |