Tsahi
Tsahi

Reputation: 455

event after list finish rendering?

I'm using a spark list to render data which I get from a web service. is there an event which fires after the list has finished rendering all the data ? I want to show a loading image to the user until the list finishes.

Thanks

Upvotes: 0

Views: 1215

Answers (2)

arieljake
arieljake

Reputation: 515

I believe the event you are looking for is updateComplete.

Upvotes: 2

J_A_X
J_A_X

Reputation: 12847

If I were you, I'd create 2 states: "loading" and "normal". The initial state is "loading" by setting currentState by default, during which it shows a loader. After that, I would have a check on the data property that you surely have somewhere. You can bind that to check if it's not null and change the state accordingly. Here's an example:

<s:Group currentState="{someDataFromService?'normal':'loading'}">
   <s:states>
      <s:State name="normal" />
      <s:State name="loading" />
   </s:states>
   <custom:SomeLoadingComponent includeIn="loading" />
   <s:List id="list" dataProvider="{someDataFromService}" enabled.loading="false" />
</s:Group>

I left out the data property since I'm sure you can figure that part out on your own.

Upvotes: 0

Related Questions