如何隐藏剑道模态窗口上的关闭按钮

时间:2014-11-21 20:43:10

标签: kendo-ui kendo-window

我的角度应用中有一个剑道模态窗口。有时我会在一秒钟后自动关闭窗口。在那些时候,我想要隐藏关闭[x]按钮,但在其他时候,不是。可以在窗口打开之前完成吗?

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

2 个答案:

答案 0 :(得分:4)

如果您不想使用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 });

答案 1 :(得分:1)

我相信你可以这样做:

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

以下是jsFiddle

示例
相关问题