Skip to main content
<div>

<button  onclick="select()" title="select" >select </button >

</div>

function select(){ 

apexclass.method()

//it will return some thing 

}

I want to display spinner until I get response from apex. 

Thanks........
2 Antworten
  1. 9. Mai 2019, 06:46
    Hi Vamsi1234,

        

    <aura:attribute name="Spinner" type="boolean" default="false"/>

    <div class="slds-is-relative">

            <aura:if isTrue="{!v.Spinner}">

                <div aura:id="spinnerId" class="slds-spinner_container">

                    <div class="slds-spinner--brand  slds-spinner slds-spinner--small" role="alert">

                        <span class="slds-assistive-text">Loading</span>

                        <div class="slds-spinner__dot-a"></div>

                        <div class="slds-spinner__dot-b"></div>

                    </div>

                </div>

            </aura:if>

    <----- Rest code of your component ---->

    <!-- Close the div -->

    </div>

    In helper:

    When your data set in your attribute, then set the value of spinner attribute false, so it can stop after data loaded in the component.

    c.set("v.Spinner", false);

    I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

    Thanks and Regards,

    Deepali Kulshrestha