I have a route which will query for 1000 records (via ember-data) and display them.
In the beginning this query is in route#model and I have a loading overlay for this page, so the whole page will really show up after model hook promise is fulfilled.
Now I have a search box in the same page, it could query for any record but it is querying another endpoint, so it doesn't need to wait for model hook fulfilled.
Since that search box doesn't depend on model, I want to use that search box right away. I move the query code outside of model hook, and send an fetchData action in view#didInsertElement, it will call the corresponding action in route, do findQuery and store response to controller. So the page will show that search box immediately, and start fetching data.
The problem is, while fetching data, the whole UI stop. I can't type anything in the search box, still need to wait for something, which is against my original goal.
Does anyone know why this happen and how to solve it? I'm using the following version of Ember. (not the latest, I know)
DEBUG: Ember : 1.7.1
DEBUG: Ember Data: 1.0.0-beta.7+canary.b45e23ba
DEBUG: Handlebars: 1.3.0
DEBUG: jQuery : 1.11.2
Aucun commentaire:
Enregistrer un commentaire