开发者

DOJO Dialog Submit with weird results

I am having an issue with the following code. The execute function executes not on the submit of the form (there is a button being created) but before the dialog even appears. The flow of the program is simply you click on a button and the dialog is supposed to be created. Any help would be greatly appreciated.

dojo.addOnLoad(function(){
   theDialog = new Dijit.Dialog({});
   theDialog.attr("Class", "soria");
}
function createDialog(){
   theDialog.attr("title", "Add New");
   theDialog.attr("Content", buildContent());
   theDialog.attr("execute", alert('hello'));
 开发者_StackOverflow社区  dojo.parser.parse(theDialog.parentNode);
   theDialog.show();
}


This is independent of Dojo. The arguments of a function are evaluated before calling the function. Perhaps you meant to quote "alert('hello')" and pass the string? Otherwise, the alert gets evaluated immediately.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜