Window Not Opening Right

2 posts, 0 answers
  1. Jamie
    Jamie avatar
    11 posts
    Member since:
    Feb 2015

    Posted 25 May 2020 Link to this post

    I'm trying to use the window in multiple spots in a small application I'm building that's using version 2020.2.513 of Kendo UI for Jquery.  I've used this many times before and never had these problems.  For some reason now when I try and use the window, no matter how I use it, I get an odd behavior.  When I first click my button that should open the window, nothing happens visually (using the inspector I can see that it moves my div tag).  When I click the button a second time, it'll open the window but then the rest of the screen goes white, the html tag does some weird sizing things that pushes everything on my page up (including the window), and the window is cut off.  

    Any ideas?  I can't share everything but I've attached a screen show of the behavior after the second click and below is the code I'm using.

    I'm literally just using a slightly modified version of the ajax example and it still happens:

    function loadHelp() {
        $("#time-window").kendoWindow({
            width: "615px",
            title: "Help",
            content: "Time-Help.htm",
            close: function() {
                 //do something
            }
        });
    }
        
  2. Ivan Danchev
    Admin
    Ivan Danchev avatar
    2152 posts

    Posted 27 May 2020 Link to this post

    Hello Jamie,

    The Window is being initialized in the loadHelp function, so that means a new Window instance is created on every click of the button. That could be problematic unless there is logic that destroys previous instances. I would suggest 2 alternative approaches you could give a try to:

    1. Initialize the Window initially and just open it in the loadHelp function, instead of re-initializing it: https://dojo.telerik.com/OqeMonOG

    2. If for some reason re-initialization is needed, destroy the existing instance before initializing a new one: https://dojo.telerik.com/OqUgariX/2

     

    Regards,
    Ivan Danchev
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
Back to Top