5

When you change pages in the Napili template, there's a spinner that displays. It's a white rectangular box with three animated dots. Is there an event I can fire through a lightning component that will display that spinner, or some other way of displaying the spinner?

Note: looking through the auradocs documentation doesn't seem to indicate there is a standard event for displaying the spinner. enter image description here

  • If you can't find a way to re-use the standard platform one (which is obviously a better way to go), the CSS is fairly simple to create your own. I use the CSS from tobiasahlin.com/spinkit for a 3 dot spinner. – Keith C Jun 10 '17 at 15:58
1

You can do this by running your own JavaScript function (from within the controller / helper of a component) when you wish to trigger the event.

To show the spinner, you can use: document.querySelector('.siteforceSpinnerManager.siteforcePanelsContainer').classList.remove('hideEl')

and to hide it again, you can use: document.querySelector('.siteforceSpinnerManager.siteforcePanelsContainer').classList.add('hideEl')

  • Not ideal, but it's the only available solution other than rolling your own spinner or using lightning:spinner. – James Loghry Jul 5 '17 at 18:16
2

You can create a component for the spinner and render only when you want, with something like a flag or even a event and hanlde with js.

<aura:attribute name="toggleSpinner" type="boolean" default="true"/>

<aura:if isTrue="{!v.toggleSpinner}">
      <c:mySpinner/>
</aura:if>

You can check this section of LDS if you want more info

Spinners

0

This cannot be achieved in the standard way so you can also create your own custom component for this and use that component in your page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.