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
Post a Comment