Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Re : Best way to bind a templated event to object created by Control

$
0
0
You may use selector based templated events only with nested elements if you want to handle events generated by "outside" element you need to use jquery-wrapped dom object, yes.

Usually controls handle behavior of "nested" elements (that is done via selector based tempated events) or elements and models supplied as options to a new control instance (thus as they exist before control's init you don't need to explicitly rebind events).  

But if you create new elements or model instances during control's init and want to handle their events with template events of the control you need to place them in contro's options and call this.on().



Viewing all articles
Browse latest Browse all 3491

Trending Articles