Do action handlers work directly in view instances?
Instead of attaching an action handler in the view, I want to bind it directly to the whole view.
JsFiddle example: http://jsfiddle.net/t3wdG/
UPDATE:
My goal is to delegate certain functions (undo, redo in this case) to parentView. The reason I have a buttonView is because when I click on each button, I want to do something with it, for example, add a css class to it.
Thus, I want all my buttons to add a class to themselves by click, and then delegate individual functions in the parent view.
Can this approach be used?
Here is the updated jsFiddle: http://jsfiddle.net/xvkgk/
source share