I made a very simple table component. It takes a model, and builds a table from it.
http://emberjs.jsbin.com/raqomebeqi/1
Since its very primitive and has hard-coded property names, I decided to make an in-component representation of the model, to sort, filter the content of the table. It also allows to show just certain columns from the bounded model. (columns property)
http://emberjs.jsbin.com/raqomebeqi/2
The problem: It doesn't react to the changes of the model anymore. In the first example If I hit the 'change' button, it takes the first record, and set a new name. One can see the change in the table. In the second case Ember inspector shows the change of the name, but the table shows the old value.
I know I could do
data: Ember.computed('model.@each.name', function(){
//...
})
to monitor the changes on the name, but it is not very dynamic. How could I make my data react to each and every change on the model?
Aucun commentaire:
Enregistrer un commentaire