开发者

dojo.hitch scope issue in onsubmit dojo/method

I have a onsubmit dojo/method within a custom templated widget like so:

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

When I call this, the scope within the dojo/method is dijit.Form. How would I go about getting the scope of the templ开发者_StackOverflow中文版ate widget instead?


I solved it by 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)); } }) );

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜