如何在具有弹出窗口时将 dojox.widget.Standby.show 应用于 html 的完整 body

How to apply dojox.widget.Standby.show to the full body of html when it has popover

我引用了这个 link How to apply standby.show to the full body of html,并在下面的代码中使用,但是待机应用于弹出窗口后面的完整 body。我希望 standBy 小部件也能覆盖弹出窗口。

 require([ "dojox/widget/Standby" ], function(st) {
            var standby = new st({
                id : "StandyBy1",
                target : dojo.body(),
            });
            document.body.appendChild(standby.domNode);
            standby.startup();
            standby.show();

        });

弹出框有一个按钮可以进行 ajax 调用。因此,当调用 ajax 时,效果应该是完整的 body,包括弹出窗口。 如何实现?

您应该将 standby.domNode 作为最后一个元素附加到您的正文标签中,并为 standby 对象设置更高的 zIndex 属性,这将允许它在堆叠顺序。

所以从你的代码来看,这一行是错误的:

document.body.appendChild(standby.domNode);

参考dojo/place可以找到here

一个工作示例:http://jsfiddle.net/sev6tcns/6/

require(["dojox/widget/Standby", "dojo/_base/window", "dojo/dom-construct"], function(Standby, win,domConstruct) {
  var standby = new Standby({
    id: "StandyBy1",
    target: dojo.body(),
    zIndex: 1000
  });
  domConstruct.place(standby.domNode, win.body());
  standby.startup();
  standby.show();
});