documentcloud/backbone — Issue #895: Include View.setElement in documentation
Author: troyastorino
Created: 2012-01-28 21:49:24+00:00
State: open

Currently, if `el` is set programmatically, event delegation will not work properly. Take the following code:
this.el = $("#id")[0];
'View.delegateEvents' now works by acting on `this.$el' (https://github.com/documentcloud/backbone/blob/master/backbone.js#L1067-1069), but this can't be seen without digging a little bit into the code. Either the documentation should specify that 'this.$el' also needs to be set, or it should indicate that 'View.setElement' should be used.