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

Load On Demand

1 Answer 127 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 08 Mar 2012, 03:14 PM
I want to only initialize\kendoify (tm) the window after a button click to help with performance...so the question is how can I check to see if it's ALREADY been initialized when the button is clicked again.

Is it like $("#window").data("kendoWindow") === null or something?

What's the proper syntax for that?

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 09 Mar 2012, 08:37 AM
Hello Steve,

Yes, you can use the following pattern:

$(".delete-button").click(function(e) {
    e.preventDefault();

    var dialog = $("#window").data("kendoWindow");

    if (!dialog) {
        dialog = $("#window").kendoWindow({ ... }).data("kendoWindow");
    }

    dialog.center().open();
});

Regards,
Alex Gyoshev
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
Alex Gyoshev
Telerik team
Share this question
or