title: IE8 script error
body: <p>We have recently downloaded a trial version of the Kendo UI suite with a view to making a purchase at the end of the trial.  We are using the Kendo grid control in Ajax binding mode and have noticed a few problems.  The main issue is that the following script error occurs when deleting the last record in the model that is bound to the grid: </p>
  
  <p>Unhandled exception at line 18, column 31059 in http://<strong><em>*</em>*</strong>/Scripts/kendo/2012.3.1114/kendo.web.js
  0x800a138f - Microsoft JScript runtime error: '_current' is null or not an object</p>
  
  <p>We cannot replicate this in Chrome.  We are interested in Kendo as it is marketed as being compatible with IE8.  This doesn't appear to be the case.</p>
  
  <p>Here is the grid in our .cshtml file:</p>
  
  <pre><code>@(Html.Kendo().Grid(Model)
      .Name("UserGrid")
      .HtmlAttributes(new { style = "height:500px" })
      .Columns(columns =&gt;
      {
          columns.Bound(p =&gt; p.ReferenceNumber).Groupable(false);
          columns.Bound(p =&gt; p.Title).Title("Title");
          columns.Bound(p =&gt; p.AgreementDate).Title("Agreement Date");
          columns.Bound(p =&gt; p.Superseded).ClientTemplate(
          "&lt;input type='checkbox' disabled='disabled' value='#= Superseded #' " +
              "# if (Superseded) { #" +
                  "checked='checked'" +
              "# } #" +
          "/&gt;");
  
          //columns.Bound(p =&gt; p.Parties.Count);
          columns.Bound(p =&gt; p.SourceDocumentLink);
          columns.Bound(p =&gt; p.RelationshipLeadDirector);
          columns.Bound(p =&gt; p.Owner);
          columns.Bound(p =&gt; p.LegalContact);
          columns.Command(command =&gt; command.Destroy()).Width(100);
          columns.Template(@&lt;text&gt;&lt;/text&gt;).ClientTemplate("&lt;a class='k-button k-button-icontext k-edit-button' href='" + Url.Action("Update", "Agreement") + "/#=Id#'&gt;&lt;span class='k-icon k-edit'&gt;&lt;/span&gt;Edit&lt;/a&gt;");        
      })
      .DataSource(dataSource =&gt; dataSource
          .Ajax()
          //.Server()
          //.Events(events =&gt; events.RequestStart("requeststart_handler"))
          //.Events(events =&gt; events.Error("error_handler"))              
          .Model(model =&gt; model.Id(p =&gt; p.Id))
          .Destroy("Delete", "Agreement")
          .Update("Update","Agreement")        
          .Read(read =&gt; read.Action("ListAgreements", "Agreement")
          ))
      .Navigatable()
      .Scrollable()
      .Resizable(s=&gt;s.Columns(true))
      .Selectable(selectable =&gt; selectable.Mode(GridSelectionMode.Single))
      .Sortable()
      .Pageable(builder =&gt; builder.PageSizes(true))
        )
  </code></pre>
  
  <p>And here is the action on our controller that takes care of a delete:</p>
  
  <pre><code>[HttpAjaxPost]
  public JsonResult Delete([DataSourceRequest] DataSourceRequest request, AgreementData agreement)
  {
      try
      {
          _agreementService.DeleteAgreement(agreement);
          ModelState.Clear();
      }
      catch (Exception ex)
      {
          Logger.GetLog(Logger.ServiceLog).Error(ex);
          ModelState.AddModelError("errors", "Delete failed");
      }
      return Json(ModelState.ToDataSourceResult());
  }
  </code></pre>
  
  <p>Is this a bug with the Kendo grid or have we missed something obvious?  Just to recap..the script error only occurs when deleting the last record in the grid.</p>