0
votes

I use kendoui window to create a dialog in first time that i click on some button the kendo window open end of my page in other time it's work good my window div is below the body tag plz help

$('#myModal').html(response);
var accessWindow = $("#myModal").kendoWindow({
    actions: ["Maximize", "Close"], /*from Vlad's answer*/
    draggable: false,
    resizable: false,
    title: "ویرایش سوال",
    width: "90%",
    visible: true
}).data("kendoWindow").center().open();
1
You may consider creating a demo in jsbin.com which shows the issue you are having. - Atanas Korchev

1 Answers

0
votes

Your example seems to work fine to me (http://jsfiddle.net/OnaBai/uspmW/) and it should not happened that your window ends placed outside body tag since you are explicitly saying where it should be.

Your full HTML should be something like:

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8"/>
    <link href="/styles/kendo.common.min.css" rel="stylesheet" type="text/css"/>
    <link href="/styles/kendo.default.min.css" rel="stylesheet" type="text/css"/>
    <script src="/js/jquery.min.js" type="text/javascript"></script>
    <script src="/js/kendo.all.min.js" type="text/javascript"></script>
</head>
<body>
Type the text to add as response here : <input type="text" id="response" class="k-widget k-textbox"/></br>
<button id="button" class="k-button">Show response</button>
<div id="myModal"></div>
<script>
    $("#button").on("click", function () {
        var response = $("#response").val();
        $('#myModal').html(response);
        var accessWindow = $("#myModal").kendoWindow({
            actions  : ["Maximize", "Close"], /*from Vlad's answer*/
            draggable: false,
            resizable: false,
            title    : "ویرایش سوال",
            width    : "90%",
            visible  : true
        }).data("kendoWindow").center().open();
    });
</script>
</body>
</html>

As a recommendation, try not creating a new window each time you want to display it. Consider creating it at the beginning or the first time that you need it and then open it each time that you need it.