dimanche 22 novembre 2015

Ember, rendering a nested collection of models asynchronously

Disclaimer: very ember newbie here so maybe what I'm asking is too basic but I don't find any explanation for this in the web

I have a parent object Report which contains a collection of Chart objects.

When I load the URL /api/reports/001/charts, the report 001 is requested to the API, then all the charts belonging to this report, then everything is rendered and .. seconds latter the page is shown to the User.

Like this:

enter image description here

What I'm trying is to offer a more progressive rendering:

  1. The report is loaded from the API
  2. The report is shown to the User with the chart elements with a loading spinner
  3. Every chart is requested to the API individually
  4. Every chart is show to the User individually

Steps 3 and 4 happen in parallel independent for each chart.

Something like this:

enter image description here

Of course I don't want anyone to come to me with a full solution, I'm looking more for orientation or maybe some link to where I can find inspiration.




Aucun commentaire:

Enregistrer un commentaire