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

Cannot Open Window On Demand

1 Answer 39 Views
Window
This is a migrated thread and some comments may be shown as answers.
kirelet
Top achievements
Rank 2
kirelet asked on 15 Feb 2014, 06:57 PM
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.  

1 Answer, 1 is accepted

Sort by
0
kirelet
Top achievements
Rank 2
answered on 15 Feb 2014, 08:51 PM
nevermind I figured it out
Tags
Window
Asked by
kirelet
Top achievements
Rank 2
Answers by
kirelet
Top achievements
Rank 2
Share this question
or