Closing a kendoui window with custom Close button within the window

前端 未结 4 1500
攒了一身酷
攒了一身酷 2021-02-07 00:02

I\'m using Kendo UI\'s window component, which is similar to any modal dialog.

I have a close button in it, how do I close the window upon clicking that button (instead

4条回答
  •  情歌与酒
    2021-02-07 00:35

    In JavaScript - HTML window is an object that represents an open window in a browser. Try defining your window as something else.

    $(document).ready(function () {
        var wnd = $("#window").data("kendoWindow");
    
        $("#open").click(function (e) {
            wnd.center();
            wnd.open();
        });
    
        $("#close").click(function(e) {
            wnd.close();
        });
    });
    

提交回复
热议问题