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.
精彩评论