简体   繁体   English

如何使模态窗口不可移动?

[英]How to make a Modal Window not movable?

I would like a modal Window but NOT movable, and couldn't find any information about this behavior in document. 我想要一个模态Window但不能移动,并且无法在文档中找到有关此行为的任何信息。 How do I disable it? 我该如何禁用它?

Currently you can use Client Side Programming to customize a not movable modal (overlapped, popup) window, the sample below create two overlapped window and make one of them not movable 目前,您可以使用客户端编程来自定义不可移动的模态(重叠,弹出)窗口,下面的示例创建两个重叠窗口并使其中一个不可移动

<zk xmlns:w="client">
    <window title="center win, movable" border="normal"
        position="center,center"
        onCreate="self.doOverlapped();" />
    <window title="top win, not movable" border="normal"
        sclass="z-window-not-movable"
        position="center,top"
        onCreate="self.doOverlapped();">
        <attribute w:name="bind_"><![CDATA[
            function (a, b, c) {
                if (!this.$class.ignoremoveOverridden) {
                    this.$class.ignoremoveOverridden = true;
                    var oldImove = this.$class._ignoremove;
                    this.$class._ignoremove = function (dg, pointer, evt) {
                        var wgt = dg.control;
                        if (jq(wgt.$n()).hasClass('z-window-not-movable')) {
                            return true;
                        }
                        return oldImove.apply(wgt, arguments);
                    }
                }
                this.$bind_(a, b, c);
            }
        ]]></attribute>
    </window>
</zk>

References: 参考文献:

Window.js Window.js

ZK Client Side Programming ZK客户端编程

If a Window has no header (no title, close button, ...) you can not move it. 如果Window没有标题(没有标题,关闭按钮,......),则无法移动它。
If you want/need the head element, I am pretty sure thre is no build in way 如果你想要/需要head元素,我很确定没有构建方式
to disable the movement. 禁用运动。 But I am interested in this too and I think this should 但我也对此感兴趣,我认为应该这样做
be added to zk tracker as a feature. 被添加到zk跟踪器作为功能。
I will take a more detailed look at the Window component and if I find a way 我将更详细地看一下Window组件,如果我找到方法的话
to disable it, I will add this. 要禁用它,我会添加它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM