title: Closing a kendoui window with custom Close button within the window
body: <p>I'm using Kendo UI's window component, which is similar to any modal dialog.</p>
  
  <p>I have a close button in it, how do I close the window upon clicking that button (instead of clicking the default 'x' button in the title bar)</p>
  
  <p>The content in my window is loaded from another view </p>
  
  <pre><code>@(Html.Kendo().Window()
             .Name("window")
             .Title("Role")
             .Content("loading...")
             .LoadContentFrom("Create", "RolesPermissions", Model.Role)
             .Modal(true)
             .Width(550)           
             .Height(300)           
             .Draggable()
             .Visible(false)
            )
  </code></pre>
  
  <p>In that same view, I have</p>
  
  <pre><code>&lt;span id="close" class="btn btn-inverse"&gt;Cancel&lt;/span&gt;
  </code></pre>
  
  <p>This is what I have in my main view (the view calling the window)</p>
  
  <pre><code>$(document).ready(function () {
      var window = $("#window").data("kendoWindow");
  
      $("#open").click(function (e) {
          window.center();
          window.open();
      });
  
      $("#close").click(function(e) {
          window.close();
      });
  });
  </code></pre>