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

Newbie coming from JQuery UI, re-show window issue

1 Answer 73 Views
Window
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 08 Aug 2014, 07:10 PM
As the title states, I'm coming from a JQuery UI background, using the jQuery Dialog. 

With JQuery UI, I just create a div like so: <div id="dlgQuestion" style="display: none;"></div>

Then I can show a dialog based on that div as often as I like with:

$('#dlgQuestion').dialog();

And if I close it using the escape key or a close button in the dialog, I can re-open it the same way without issues, the dom has not had the div removed.

I've successfully figured out how to show a kendo window wiith similar code:

$("#dlgQuestion").kendoWindow({
            actions: ["Minimize", "Maximize", "Close"],
            height: 500,
            width: 500,
            visible: true,
            position: { top: 100, left: 300 }
        });

but, once I close it I cannot show it again.

I've read through a lot of the documentation, but this is eluding me. I probably need to use a destroy function somehow before attempting to re-show it, but maybe someone could give me more precise guidance.

Side question, is coming from JQuery UI an advantage or a hindrance due to having to "un-learn" old habits?

Thanks, Bob Graham

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 12 Aug 2014, 08:29 AM
Hello Robert,

The problem is caused by the fact that you are initializing the window more than once. Please note that every time you call .kendoWindow() , you are creating a new widget instance, that overrides the old one and can cause the problem that you are facing. This is why we suggest the usage of the open/close methods, that will not initialize a new widget every time, here is more information about it:

http://docs.telerik.com/kendo-ui/api/web/window#methods-open

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Window
Asked by
Robert
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or