2013-01-02 19 views
4

我想一個模式Window但不可移動,無法找到有關此問題在文件的任何信息。我如何禁用它?如何使模態窗口不可移動?

+0

您正在使用哪個平臺?視窗? –

+0

這是關於ZK-Web-Framework,它是否是Windows無關緊要。 –

回答

3

目前,你可以使用客戶端編程自定義一個不可移動的模式(重疊,彈出)窗口,下面的示例創建兩個重疊的窗口,使他們中的一個不可移動的

<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> 

參考文獻:

Window.js

ZK Client Side Programming

+0

謝謝,這正是我所需要的。我想現在是時候學習一些小部件定製。 :) –

1

如果Window沒有頭(沒有標題,關閉按鈕......),你可以不動它。
如果你想/需要head元素,我敢肯定THRE是這樣
禁用運動沒有建立。但我有興趣在此也和我想這應該
被添加到ZK跟蹤的功能。
我會在Window組件更詳細的研究,如果我找到一個方法
禁用它,我會補充這一點。