lundi 6 juillet 2015

SortBy in Ember.js not working on newly created Items

I applied a sortBy on date(time) attribute like this,

cars = @store.all('car')
cars.filter (car) =>
   if car.get('name') == undefined
      @store.find('car', car.get('id')).then ->
      console.log('record found')
   else
      cars

cars.sortBy('messageAt','name').reverse()

It does work when I reload the page, but as soon as I get a new message in Ember data, it does appear in messages but at the bottom, which means sorting does not work.




Aucun commentaire:

Enregistrer un commentaire