Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

didLoad not triggered for each record in a collection #1317

Closed
gerry3 opened this Issue Sep 17, 2013 · 5 comments

Comments

Projects
None yet
2 participants
Contributor

gerry3 commented Sep 17, 2013

#1307 was closed, but it still isn't working as expected:

didLoad is not working for me (running // Last commit: 8e8ed7e (2013-09-15 17:24:13 -0700)). At least not like it did in 0.13 nor like @wycats suggested in #1307.

I have defined my model as suggested:

App.Post = DS.Model.extend({
  someSetup: function() {
   console.log('setup');
  }.on('didCreate', 'didLoad')
});

And also put a console.log here:

    // EVENTS
    pushedData: function(record) {
      record.transitionTo('loaded.saved');
      console.log('pushedData - didLoad');
      record.triggerLater('didLoad');
      set(record, 'isError', false);
    },

When my collection of records loads (via @store.find('post', <query params>): 'pushedData - didLoad' is displayed once and my someSetup method is not called.

On the other hand, when I create and save() a new record: 'setup' is displayed once and pushedData is not called.

Owner

wycats commented Sep 18, 2013

Can you create a JSBin that demonstrates this issue?

@wycats wycats closed this in a29dbcf Sep 19, 2013

Owner

wycats commented Sep 19, 2013

Thanks so much!

Contributor

gerry3 commented Sep 19, 2013

@wycats wow, fixed in less than an hour! BTW, we really appreciate the amazing progress on EmberData these last few weeks. So great to see the plans outlined at the penultimate meetup so quickly come to fruition by last night's meetup.

Owner

wycats commented Sep 19, 2013

As I've always said, giving me a simple JSBin that illustrates an issue makes me about 10x (or even 100x) more productive at fixing issues :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment