我在一个自定义的模板化小部件中有一个onsubmit dojo/方法,如下所示:
try { if (this.validate()) { //console.debug(this); SubmitForm(dojo.hitch(this, this.Send)); } } catch (e) { console.debug(e); } return false; 当我调用它时,dojo/方法中的作用域是dijit.Form。我该如何获取模板部件的作用域呢?
发布于 2010-07-27 10:25:21
我通过这样做解决了这个问题:
dojo.connect(dojo.byId(this.form.id),"onsubmit",dojo.hitch(this,dojo.byId(E){ e.preventDefault();if (this.GetForm().validate()) { SubmitForm(dojo.hitch(this,this.Send);} }) );
https://stackoverflow.com/questions/3337352
复制相似问题