{{each}} and CollectionView help
http://stackoverflow.com/questions/10686670/do-something-when-ember-is-done-with-dom-updates/10687970
HTML
<script src="https://github.com/downloads/emberjs/ember.js/ember-0.9.8.js"></script>
<script type="text/x-handlebars" data-template-name="the_template">
<div style="height:200px;"></div>
</script>
<script type="text/x-handlebars">
{{view App.view}}
</script>
JavaScript
App = Ember.Application.create();
App.model = Ember.Object.create({
items: [1]
});
App.view = Ember.Handlebars.EachView.extend({
contentBinding: 'App.model.items',
itemViewClass: Ember._MetamorphView.extend({
templateName: 'the_template'
}),
modelChanged : function() {
Ember.run.next(this, function(){
window.scrollTo(0, document.body.scrollHeight);
$('body').append('New scroll height: '+document.body.scrollHeight);
});
}.observes('content'),
theAction: function(event) {
App.controller.doStuffToModel();
}
});
App.controller = Ember.Object.create({
doStuffToModel : function() {
App.model.set('items', [1,2,3,4,5]);
}
});