Hi guys,
I finally have an opportunity to upgrade my JS framework. I've been using JavascriptMVC since 2010. I studied up on the alternatives for new coolness and it turns out that it's offspring, CanJS, is the coolest one around. Good work.
I have a click handler accessed via "can-click='saveItem" (can.Control, can.view with can.stache). It works great and is a real time saver.
The problem is that all the click handlers on dom objects containing it also trigger. As with JMVC, CanJS hands (element, event) to the handler. Unlike JMVC, or the rest of jQuery, event.stopPropagation() gets me an error message saying " TypeError: event.stopPropagation is not a function". Same with preventDefault().
I have to figure I am missing something but haven't been able to find a word on the matter. Help will be appreciated.
best,
tqii
ps, I found this: http://canjs.com/docs/can.event.propagate.html
It seemed like it might do something good. It's "download" button gave me an error message. It's github link lead me to CanJs overall. FYI
I finally have an opportunity to upgrade my JS framework. I've been using JavascriptMVC since 2010. I studied up on the alternatives for new coolness and it turns out that it's offspring, CanJS, is the coolest one around. Good work.
I have a click handler accessed via "can-click='saveItem" (can.Control, can.view with can.stache). It works great and is a real time saver.
The problem is that all the click handlers on dom objects containing it also trigger. As with JMVC, CanJS hands (element, event) to the handler. Unlike JMVC, or the rest of jQuery, event.stopPropagation() gets me an error message saying " TypeError: event.stopPropagation is not a function". Same with preventDefault().
I have to figure I am missing something but haven't been able to find a word on the matter. Help will be appreciated.
best,
tqii
ps, I found this: http://canjs.com/docs/can.event.propagate.html
It seemed like it might do something good. It's "download" button gave me an error message. It's github link lead me to CanJs overall. FYI