I am trying to capture the width of a child view from within a view. From my research I have found that the proper way to do this is to use scheduleOnce inside of the views didInsertElement. This should ensure that all of the views children have loaded. This is not working, however. When i log out the width , it is 50 or so px less than it should be. every time. if I put a 50 ms settimeout, the width will log out correct. Below is the pattern I am using.
App.MyCollectionView = Ember.CollectionView.extend({
didInsertElement: function() {
Ember.run.scheduleOnce('afterRender', this, 'processChildElements');
},
processChildElements: function() {
var el = this.get('element');
var childWidth = $(el).find('.childElement').width();
}
});