dojo.hitch scope issue in onsubmit dojo/method -


i have onsubmit dojo/method within custom templated widget so:

try { if (this.validate()) { //console.debug(this); submitform(dojo.hitch(this, this.send)); } } catch (e) { console.debug(e); } return false;

when call this, scope within dojo/method dijit.form. how go getting scope of template widget instead?

i solved doing this:

dojo.connect(dojo.byid(this.form.id), "onsubmit", dojo.hitch(this, function(e) { e.preventdefault(); if (this.getform().validate()) { submitform(dojo.hitch(this, this.send)); } }) );


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -