uiActions and preventing default handling ....

12 views
Skip to first unread message

ladd.james

unread,
Nov 7, 2012, 9:54:35 PM11/7/12
to mari...@googlegroups.com
I have a view with a uiAction that looks like this:

    uiActions: {
        'click button.go'  : 'onGo',
    },

and this invokes onGo in the controller just fine.

What should I do if I want the handling of the click to be stopped?
ie: in pure javascript I would use a 'return false'

I've been doing this in my controller

if (event.preventDefault)
    event.preventDefault();
else
    event.returnValue = false;

Do I need to do this with maria?


Peter Michaux

unread,
Nov 7, 2012, 9:59:15 PM11/7/12
to mari...@googlegroups.com
You don't do this with Maria. You can use any browser normalization
library (e.g. YUI, Dojo, etc). At the very least, moving this out as a
common utility function (e.g myApp.preventDefault) would be a good
idea, I think.

Peter
Reply all
Reply to author
Forward
0 new messages