This is a migrated thread and some comments may be shown as answers.

Window only opens once in MVVM

4 Answers 186 Views
Window
This is a migrated thread and some comments may be shown as answers.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 20 Jun 2012, 04:42 PM
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?

4 Answers, 1 is accepted

Sort by
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 20 Jun 2012, 04:49 PM
...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)
0
Atanas Korchev
Telerik team
answered on 25 Jun 2012, 03:02 PM
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!
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 25 Jun 2012, 03:20 PM
...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?
0
Alexander Valchev
Telerik team
answered on 28 Jun 2012, 12:38 PM
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!
Tags
Window
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Atanas Korchev
Telerik team
Alexander Valchev
Telerik team
Share this question
or