I have this working, but I’m still testing out how to make it easiest to use within the designer. The biggest problem I see with your current situation (and one of the reasons why it isn’t working yet) is because you’re using lds-spinner
as an animation
value when lds-spinner
should be typed into style.classes
, like so:
However, that still won’t work. If you look at the actual CSS in a session using the browser’s dev tools, you’ll see that psc-
will be prepended to your style class lds-spinner
.
To fix this, go back to your webdev resource (or MyCSS.css) and change every instance of lds-spinner
to psc-lds-spinner
.
HOWEVER, this still might not work. For instance, the markup that is given in the docs you included above looks something like this:
<div class="lds-spinner">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
Those extra divs actually need to be there for the spinner to work. There is not Perspective component that has the structure. For instance, if you look at a basic Label component, here is the markup that’s associated with it:
<div data-component="ia.display.label" data-component-path="C.0:1" class="ia_labelComponent" style="display: flex; flex-direction: column; justify-content: center; flex: 0 1 32px;">
<span>Label</span>
</div>
This is clearly a different structure, so your animation won’t work OR it won’t do what you want it to.
HOWEVERER, there is a way to do what you want to do, but it will require you create two WebDev resources. You create your HTML and CSS text resource and then you can use an Inline Frame component to embed your spinner or whatever loading animation you want into your view. Then you would have a binding that will show and hide the iframe depending on some state. For example, when a table is loading data (before props.data
is populated, which is an easy binding), you can set the iframe’s meta.visible
property to true
and then when all of the table is loaded, you can set the iframe to false
. The animation will still be playing in the background, it just won’t be visible to the user. I don’t know what the performance issues with this approach might be…
If you need some help on getting this done, I can set up a project and demonstrate it for you…
EDIT: Just so you know I have it working: