mbest/knockout — Issue #3: use events for DOM-related notification
Author: mbest
Created: 2011-12-17 09:16:08+00:00
State: open

afterRender, afterAdd, and beforeRemove are Knockout events, but are not handled as DOM events. Thus you have to handle them through a special binding.

I propose that these be changed to trigger events either through the DOM interface or through jQuery using ko.utils.triggerEvent. ko.utils.triggerEvent will need a change, though, to allow for custom data to be passed along with the event. For backwards compatibility, the afterAdd, etc. binding can be set up to listen for the equivalent event.