我已经尝试在dojo中创建一个带有进度条的对话框。
当它可见时,在onshow事件中,我想触发一个递归函数来处理代码,并更新进度条。问题是,onshow在对话框可见之前触发,并且递归处理完成并在进度条变为可见之前销毁带有进度条的对话框
这是一个模糊的代码示例(忽略一些自定义类,如panelManager等。当对话框显示时,我有一个我希望调用的函数..
register_dialog = panelManager.getActive();
//createPanel(panelManager.getActive().domNode, true, '', "Number of " + text_correction("Sample")+"s Registered", '', null, 90, 290, null, false, null);
dialog = new dialog_simple({
title: "Number of " + text_correction("Sample")+"s Registered",
isLayoutContainer: true,
containerNode: register_dialog.domNode,
href: "blank.html",
preload: true,
parseOnLoad: true
});
dialog.domNode.style.width = "290px";
dialog.domNode.style.height = "70px";
progress = new ProgressBar({
style: "width:270px",
id: "register_progress",
maximum: numOfSamples,
value: 0,
label: "0 of " +numOfSamples
});
dialog.on("show", function() {
startRegister(theJSON, theHeaderData, currentSample, theSamples, dialog, progress, register_dialog);
});
dialog.on("cancel", function() {
dijit.registry.remove(progress.id);
progress.destroy();
dialog.destroyRecursive()
});
dialog.set("content",progress);
progress.startup();
dialog.startup();
dialog.show();
无论如何,它会在对话框可见之前触发该功能......想法?