documentcloud/backbone — Issue #728: Ability to completely unbind all events for a view in dynamic situations
Author: csmaster2005
Created: 2011-11-08 08:56:11+00:00
State: open

I'm hitting an issue that I haven't found a good solution for. My page is extremely dynamic, and I load in views which may bind to the same elements.
I may also create the same view once, create a different view, then recreate the first one. The issue though is the event handlers persist and I will find the event is firing twice.

So my 'flow' would be viewA --> viewB --> vewA which causes the newest A view to double fire events.

It feels like for completely dynamic pages, an application would want the ability to completely 'destroy' or 'unbindAllEvents' for a given view, which I cant seem to figure out. Is there a known solution for this? If not, is it something others feel is needed? I could code it and provide a pull request if others want.

Thanks