This question demonstrates that overriding an Ember.View instance's didInsertElement
allows you to execute some code after the view's element is in the DOM.
http://jsfiddle.net/gvUux/2/
Naturally, overriding didInsertElement
on the child view class you add to an Ember.CollectionView will run the hook after each child view is rendered and inserted.
http://jsfiddle.net/BFUvK/1/
Two collection-oriented hooks on Ember.CollectionView, arrayDidChange
and contentDidChange
, execute after the underlying content has changed, but they execute before any rendering takes place. arrayDidChange
is executed for every element added to the array, and contentDidChange
wraps the content binding.
I would like to be able to hook around the rendering pipeline, something like willInsertCollection
and didInsertCollection
, to manipulate the DOM before and after all child elements are rendered - essentially, before and after filters around contentBinding
.
Any ideas? I'm stumped.
If you want to want to do something before and/or after a view has been rendered you should use willInsertElement
and/or didInsertElement
respectively. In this case, since you want "to manipulate the DOM before and after all child elements are rendered" you should call those on your CollectionView.
I'm not quite sure what you mean by "before and after filters around contentBinding
", so if this doesn't answer your question if you could clarify I'd be happy to help.
jsFiddle if needed
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With