Window only opens once in MVVM

5 posts, 0 answers
  1. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 20 Jun 2012 Link to this post

    Ok here's my window
    <div id="edit-window" data-role="window" data-visible="false" data-modal="true" data-iframe="true" data-resizable="false" data-minWidth="600px">
            </div>
    (width is ignored btw, but thats besides the point)

    So I then have a click event, based on a template item which calls this
    onRunVerb: function (verb) {
        var
    window = $("#edit-window").data("kendoWindow");
                        window.title(verb.data.text);
                        window.content("<div class='loading''>Loading...</div>");
                        window.refresh(verb.data.url);
                        window.center().open();
    }

    Works great...until I close the window, then click on another button which calls this again...


    window is undefined
    window.title(verb.data.text);

    Ideas?...does it destroy itself on close or something?
  2. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 20 Jun 2012 Link to this post

    ...I can get it to work by storing it, but why does it not work the otherway?
    if (this.modalWindow === null)
                            this.modalWindow = $("#edit-window").data("kendoWindow");
     
                        this.modalWindow.title(verb.data.text);
                        this.modalWindow.content("<div class='loading''>Loading...</div>");
                        this.modalWindow.refresh(verb.data.url);
                        this.modalWindow.center().open();

    sidenote, can you get your admins to fix this (attached)
  3. Kendo UI is VS 2017 Ready
  4. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 25 Jun 2012 Link to this post

    Hi Steve,

     This works for me: http://jsfiddle.net/korchev/DWUnx/2/ 

    Regards,
    Atanas Korchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  5. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 25 Jun 2012 Link to this post

    ...you're right, I don't know what to tell you :)  I'm going to have to try and replicate it outside the app.

    http://jsfiddle.net/stevescotthome/YhnUU/9/

    ...minWidth though doesn't seem to be picked up, do I have that syntax wrong?
  6. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 28 Jun 2012 Link to this post

    Hi Steve,

    The correct syntax is: data-min-width="1200px" 
    For convenience I have updated your fiddle, please check the result - http://jsfiddle.net/valchev/YhnUU/26/ 

    Regards,
    Alexander Valchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready