Ember-Data callback when findAll finished loading all records

前端 未结 1 880
野性不改
野性不改 2021-02-15 13:49

With ember-data I\'m loading all records of a model with:

App.adapter = DS.Adapter.create({
  findAll: function(store, type) {
      var url = type.url;
      jQ         


        
相关标签:
1条回答
  • 2021-02-15 14:26

    Yes, you can use findQuery, and then observe .isLoaded property on the ModelArray.

    e.g:

    load: ->
        @set 'data', @get('store').findQuery App.MyModel, { q: '...' }
    

    And have the observation:

    loadingComplete: ( ->
        @doSomeStuff() if @getPath 'data.isLoaded'
    ).observes 'data.isLoaded'
    
    0 讨论(0)
提交回复
热议问题