2014-11-21 62 views
0

我的角度應用程序中有一個kendo模式窗口。有時我會在一秒鐘後自動關閉窗口。在那些時候,我想隱藏關閉[x]按鈕,但在其他時間,不是。可以在窗口打開之前完成嗎?如何隱藏kendo模式窗口上的關閉按鈕

if (autoCloseDelay)  { 
     // hide the close [x] button here ?? 
     $timeout(function() { 
      $scope.modalWindow.close(); 
     }, autoCloseDelay, $scope); 
    } 
    $scope.modalWindow.open(); 

回答

3

如果你不想用CSS玩,你可以使用setOptions設置編程行動。

用於除去 Close按鈕

實施例:

// Get current actions 
var actions = $scope.modalWindow.options.actions; 
// Remove "Close" button 
actions.splice(actions.indexOf("Close"), 1); 
// Set the new options 
$scope.modalWindow.setOptions({ actions : actions }); 
+0

由於這種方法「按原樣」工作,它會得到綠色的複選標記。謝謝 – Tim 2014-11-22 18:40:32

0

我相信你能做到這樣的:

// hide the close [x] button 
$scope.modalWindow.parent().find(".k-window-action").css("visibility", "hidden"); 

下面是一個簡單jsFiddle

+0

感謝。我大概可以適應這種方法,但是它與角衛的劍道指令並不完全一樣。 – Tim 2014-11-22 17:34:36

相關問題