I want to do things when ember bindings are in sync and the DOM is updated again.
I tried with a callback from a function that manipulates the bound model, the DOM is not updated when the callback is made.
I tried with the observer directly on the model, the DOM is not updated when the observer is executed.
I tried with the observer to bind, the DOM is not updated when the observer is executed.
eg.
App.view = Ember.View.extend({
modelBinding: 'App.model',
modelChanged : function() {
window.scrollTo(0, document.body.scrollHeight);
}.observes('model'),
getMore: function(event) {
App.set('model', "somethingnew");
}
});
When I run "gotMore", I update the model, and when the model is updated and its changes are displayed, I want to scroll down.
None of the methods I tried could get a new scrollHeight. After these events, several ms are set.
Here is a jsFiddle example:
http://jsfiddle.net/kcjzw/15/