简体   繁体   中英

Kendo window restore is not calling resize event when minimized then restored

As per telerik documentation, Kendo window restore should call resize event. It works as documented when window is maximized & then restored. But, it's not calling resize event when window is minimized & then restored. I want to add some logic when window is minimized & then restored. Any idea how can I achieve this. Here is a sample kendo window

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Kendo UI Snippet</title>

<link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.1.412/styles/kendo.common.min.css"/>
<link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.1.412/styles/kendo.rtl.min.css"/>
<link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.1.412/styles/kendo.silver.min.css"/>
<link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.1.412/styles/kendo.mobile.all.min.css"/>

<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://kendo.cdn.telerik.com/2016.1.412/js/kendo.all.min.js">     </script>
</head>
<body>

<div id="dialog"></div>
<script>
$("#dialog").kendoWindow({
                        width: "90%",
                        height: "90%",
                        title: "Lease Log",
                        position: { top: "5%", left: "5%" },
                        actions: [
                            "Pin",
                            "Minimize",
                            "Maximize",
                            "Close"
                        ],
                        resize: function(){
                            alert("resized")
                        },
                        restore: function(){
                            alert("restored")
                        },
                        maximize: function(){
                            alert("maximized")
                        },
                        minWidth: 500,
                        minHeight: 300
                    });
</script>
</body>
</html>

Per Telerik's documentation they do not have a restore event. The only thing I've been able to come up with is to add a mouse down event to the restore icon from the window's minimize and maximize events:

  $('.ki-restore').on("mousedown", function (e) { console.log('restored'); }); 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM