Cannot Open Window On Demand

2 posts, 0 answers
  1. kirelet
    kirelet avatar
    5 posts
    Member since:
    Sep 2013

    Posted 15 Feb 2014 Link to this post

    I have the following code:
    <section>
        @(Html.Kendo().Window()
            .Modal(true)
            .Name("window")
            .Height(200)
            .Width(400)
            .Title("Case Documents")
            .Visible(false)
            .LoadContentFrom("Index", "Home")  
            .Pinned(true)
            )
     
        <a id="openButton">Open Window</a>


    Then after it, I have:
    // this works when the page is loaded
     $(function () {
          $("#window").data("kendoWindow").center().open();
      });
     
    // this does not work, even if I remove the above code, it says $(...).data(...) is undefined
      $($("#openButton").click(function () {
          $("#window").data("kendoWindow").center().open();
      }));
    Basically, once the page is loaded, I can no longer open the window, regardless of whether it was opened on document ready event or not.  I do not understand why the $("#window").data("kendoWindow") object is undefined.  
  2. kirelet
    kirelet avatar
    5 posts
    Member since:
    Sep 2013

    Posted 15 Feb 2014 in reply to kirelet Link to this post

    nevermind I figured it out
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top