Load On Demand

2 posts, 0 answers
  1. Steve
    Steve avatar
    1851 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
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 09 Mar 2012 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
Back to Top