如何阻止用户对zk处理的操作?

时间:2015-09-28 16:48:11

标签: zk

我正在使用zk 7.0.3

我的应用程序有一些很长的过程,我想在长时间进程打开时阻止用户操作。我尝试使用它,但不起作用:

<device-config>
    <!-- Configure the progress message to show in the center -->
    <device-type>ajax</device-type>
    <embed><![CDATA[
    <script type="text/javascript">
        AU_progressbar = function (id, msg) 
        {
            Boot_progressbox(id, msg, 0, 0, true, true);
        };
    </script>
]]></embed>
</device-config>

2 个答案:

答案 0 :(得分:0)

您可以参考本指南 - Long Operations

例如, Clients.showBusy("Execute..."); //show a busy message to user

答案 1 :(得分:0)

在您的项目中创建一个JS文件,如MyFile.js,并在此JS

中添加以下代码
zk.procDelay = 100;
if (!zUtl.oldProgressbox) {
 zUtl.oldProgressbox = zUtl.progressbox;
 zUtl.progressbox = function(id, msg, mask, icon, _opts) {
  if(getCookie("language")=="fr_ca") {
   zUtl.oldProgressbox(id, "Traitement de votre demande, s'il vous plaît patienter ...", true, icon, _opts);
  } else {
   zUtl.oldProgressbox(id, 'You can add any text here...', true, icon, _opts);
  }
 }
}

将此{fileName}.js添加到lang-addon.xml文件中,如下所示

<javascript src="/resource/js/fileName.js" />