2014-11-21 158 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

相关问题