title: Bind click event after deferred initialization of Kendo Grid
body: <p><strong>How can I bind the click event after the deferred script is loaded?</strong></p>
  
  <p>I have a Kendo Grid (in Razor) with deferred initialization due performance issues. So all js scripts are included in the end of the document.</p>
  
  <pre><code>@(Html.Kendo().Grid&lt;MyViewModel&gt;()
      .Name("myGrid")
      .Columns(columns =&gt;
      {
          columns.Bound(c =&gt; c.Name);
          columns.Bound(c =&gt; c.City);
          columns
              .Bound(c =&gt; c.Id)
              .Title("Commands")
              .Sortable(false)
              .Filterable(false)
              .ClientTemplate(
                  "&lt;a href='" + @Url.Action("Details", new { id = "#=Id#" }) + 
                      "' class='btn btn-success' title='Details'&gt;" +
                      "&lt;span class='glyphicon glyphicon-list'&gt;&lt;/span&gt;&lt;/a&gt;" +
                  "&lt;a href='" + @Url.Action("Edit", new { id = "#=Id#" }) +
                      "' class='btn btn-info' title='Edit'&gt;" +
                      "&lt;span class='glyphicon glyphicon-pencil'&gt;&lt;/span&gt;&lt;/a&gt;" +
                  "&lt;a href='\\#' data-id='#=Id#' data-action='deactivate' " +
                      "class='btn btn-warning' title='Desactivate'&gt;" +
                      "&lt;span class='glyphicon glyphicon-remove-sign'&gt;&lt;/span&gt;&lt;/a&gt;"
              );
      })
      .Pageable()
      .Sortable()
      .Filterable()
      .DataSource(ds =&gt; ds
          .Ajax()
          .Read(read =&gt; read.Action("ReadData", "MyController")).Sort(a =&gt; a.Add("Name")))
      .Deferred()
  )
  </code></pre>
  
  <p>Then I have a section at the end where I want to bind a click event to the <code>&lt;a&gt;</code> click of every element which a <code>data-action='deactivate'</code> attribute. The problem is the deffered initialization is performed after my document is ready.</p>
  
  <pre><code>@section scripts {
      @Scripts.Render("~/bundles/kendo")
  
      @Html.Kendo().DeferredScripts()
  
      &lt;script&gt;
          $(document).ready(function () {
              $('[data-action="deactivate"]').click(function (event) {
                  var id = $(event.target).attr('data-id');
                  alert(id);
              });
          });
      &lt;/script&gt;
  }
  </code></pre>