delegateEvents in backbone.js
Can anyone please explain me what delegateEvents in backbone.js does? The documentation did not help me to understand. My exact use case is: I have a main view X with an inner view Y. They work great, but if I go to main view Z and then go back to X (reusing, not recreating) then events attached to Y child elements get lost. delegateEvents solves this but I want to understand why. Essentially, when you call .remove() it is a proxy to the jQuery remove function, which removes the element from the DOM, as well as all associated events from the event hash that were bound to the element. Backbone