Load On Demand

2 posts, 0 answers
  1. Steve
    Steve avatar
    1871 posts
    Member since:
    Dec 2008

    Posted 08 Mar 2012 Link to this post

    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?
  2. Alex Gyoshev
    Alex Gyoshev avatar
    2515 posts

    Posted 09 Mar 2012 Link to this post

    Hello Steve,

    Yes, you can use the following pattern:

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

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

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


    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!
Back to Top