【问题标题】:how to hide the close button on a kendo modal window如何隐藏剑道模式窗口上的关闭按钮
【发布时间】:2014-11-21 20:43:09
【问题描述】:

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

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

【问题讨论】:

    标签: kendo-ui kendo-window


    【解决方案1】:

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

    【讨论】:

    • 由于这种方法“按原样”工作,它得到绿色复选标记。谢谢
    【解决方案2】:

    我相信你可以这样做:

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

    这是一个示例jsFiddle

    【讨论】:

    • 谢谢。我可能可以适应这种方法,但它与 angular 的 kendo 指令并不完全相同。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-19
    • 2015-12-01
    • 1970-01-01
    相关资源
    最近更新 更多