title: jqGrid : Uncaught TypeError: Cannot read property 'getAccessor' of undefined while reading xml data
body: <p>My jqGrid works fine, loads data properly. Even sorting and pagination are working fine.
  But, when filterToolBar is used to search data, it doesn't search any data...just keeps showing 'Loading...'.</p>
  
  <p>Below are script taggings included in <strong>HEAD</strong> part:</p>
  
  <pre><code> &lt;script src="~/Scripts/js/jquery-1.11.0.min.js" type="text/javascript"&gt;&lt;/script&gt;    
   &lt;script src="~/Scripts/js/src/i18n/grid.locale-en.js" type="text/javascript"&gt;&lt;/script&gt;
   &lt;script src="~/Scripts/js/jquery.jqGrid.min.js" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;table id="jqGrid" &gt;&lt;/table&gt;
  &lt;div id="pager"&gt;&lt;/div&gt;
  
  
  &lt;script type="text/javascript"&gt;
  $("#jqGrid").jqGrid({
      url: "GetData.asmx/LoadData",
      datatype: "xml",     
      xmlReader: {
          repeatitems: false,            
          root: "Rowset",
          row: "Row"
      },
      colNames: ["Id","Contact Name", "City", "Country"],
      colModel: [
          { name: 'id', index: 'id', width: 40, stype: 'text',sortable:true },
          { name: "ContactName", index: "ContactName", sortable: true, width: 300,        search: true, stype: 'text' },
          { name: "City", index: "City", sortable: true, width: 300, search: true, stype: 'text' },
          { name: "Country", index: "Country", sortable: true, width: 300, search: true, stype: 'text' }
      ],
      rowNum: 10,
      rowList: [10, 20, 50, 100],
      pager: "#pager",
      gridview: true,
      rownumbers: true,
      viewrecords: true,
      height: "auto",        
      loadonce: true,       
      sortorder: "desc",
      caption: "List of Employees",
      ignoreCase: true        
  }).jqGrid("filterToolbar", { searchOnEnter: false, stringResult: true, defaultSearch:   "cn" });
  
   &lt;/script&gt;
  </code></pre>
  
  <p>Please look into this code and guide me, where it is getting wrong.</p>
  
  <p>Thanks in advance,
  Dipti Sheth</p>
  
  <p><strong>UPDATED:</strong></p>
  
  <p>Following is the xml response:  </p>
  
  <pre><code>      &lt;Rowsets DateCreated="2013-05-02T09:18:07" EndDate="2013-05-02T09:18:07" StartDate="2013-05-02T08:18:07" Version="12.0.6 Build(13)"&gt;
  &lt;Rowset&gt;
  &lt;Columns&gt;
  &lt;Column Description="Id" MaxRange="1" MinRange="0" Name="Id" SQLDataType="12" SourceColumn="Id"/&gt;
  &lt;Column Description="ContactName" MaxRange="1" MinRange="0" Name="ContactName" SQLDataType="12" SourceColumn="ContactName"/&gt;
  &lt;Column Description="City" MaxRange="1" MinRange="0" Name="City" SQLDataType="12" SourceColumn="City"/&gt;
  &lt;Column Description="Country" MaxRange="1" MinRange="0" Name="Country" SQLDataType="12" SourceColumn="Country"/&gt;
  &lt;/Columns&gt;
  &lt;Row&gt;
  &lt;id&gt;1&lt;/id&gt;
  &lt;ContactName&gt;Maria Anders&lt;/ContactName&gt;
  &lt;City&gt;Berlin&lt;/City&gt;
  &lt;Country&gt;Germany&lt;/Country&gt;
  &lt;/Row&gt;
  &lt;Row&gt;
  &lt;id&gt;2&lt;/id&gt;
  &lt;ContactName&gt;Ana Trujillo&lt;/ContactName&gt;
  &lt;City&gt;México D.F.&lt;/City&gt;
  &lt;Country&gt;Mexico&lt;/Country&gt;
  &lt;/Row&gt;
  &lt;Row&gt;
  &lt;id&gt;3&lt;/id&gt;
  &lt;ContactName&gt;Antonio Moreno&lt;/ContactName&gt;
  &lt;City&gt;México D.F.&lt;/City&gt;
  &lt;Country&gt;Mexico&lt;/Country&gt;
  &lt;/Row&gt;
  &lt;Row&gt;
  &lt;id&gt;4&lt;/id&gt;
  &lt;ContactName&gt;Thomas Hardy&lt;/ContactName&gt;
  &lt;City&gt;London&lt;/City&gt;
  &lt;Country&gt;UK&lt;/Country&gt;
  &lt;/Row&gt;
  &lt;Row&gt;
  &lt;id&gt;5&lt;/id&gt;
  &lt;ContactName&gt;Christina Berglund&lt;/ContactName&gt;
  &lt;City&gt;Luleå&lt;/City&gt;
  &lt;Country&gt;Sweden&lt;/Country&gt;
  &lt;/Row&gt;
  &lt;Row&gt;
  &lt;id&gt;6&lt;/id&gt;
  &lt;ContactName&gt;Hanna Moos&lt;/ContactName&gt;
  &lt;City&gt;Mannheim&lt;/City&gt;
  &lt;Country&gt;Germany&lt;/Country&gt;
  &lt;/Row&gt;
  &lt;/Rowset&gt;
  &lt;/Rowsets&gt;
  </code></pre>
  
  <p><strong>RESPONSE HEADER:</strong>    in Network tab of debugger of Chrome</p>
  
  <pre><code>Cache-Control:private, max-age=0
  Content-Encoding:gzip
  Content-Length:636
  Content-Type:text/xml; charset=utf-8
  Date:Wed, 09 Jul 2014 12:34:15 GMT
  Server:Microsoft-IIS/8.0
  Vary:Accept-Encoding
  X-AspNet-Version:4.0.30319
  X-Powered-By:ASP.NET
  X-SourceFiles:=?UTF-8?B?QzpcUHJvamVjdHNcanFHcmlkU2FtcGxlXGpxR3JpZFNhbXBsZVxHZXREYXRhLmFzbXhcTG9hZERhdGE=?=
  ConsoleSearchEmulationRendering
  </code></pre>
  
  <p>Thanks,
  Dipti Sheth</p>
  
  <p><strong>EDITED:</strong>
  <strong>_Layout.cshtml page:</strong></p>
  
  <pre><code> &lt;!DOCTYPE html&gt;
    &lt;html&gt;
     &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="IE=edge" /&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
      &lt;title&gt;@ViewBag.Title - My ASP.NET Application&lt;/title&gt;
      @Styles.Render("~/Content/css")
      @Scripts.Render("~/bundles/modernizr")
  
     &lt;link href="~/Scripts/jquery-ui-1.11.0.custom/jquery-ui.theme.css" rel="stylesheet"  media="screen" type="text/css" /&gt;
     &lt;link href="~/Content/ui.jqgrid.css" rel="stylesheet" media="screen" type="text/css" /&gt;
     &lt;style&gt;
      html, body {
          margin: 0;
          padding: 0;
          font-size: 75%;            
      }
     &lt;/style&gt;
     &lt;script src="~/Scripts/js/jquery-1.11.0.min.js" type="text/javascript"&gt;&lt;/script&gt;  
     &lt;script src="~/Scripts/jquery-ui-1.11.0.custom/jquery-ui.min.js" type="text/javascript"&gt;&lt;/script&gt;
     &lt;script src="~/Scripts/js/src/i18n/grid.locale-en.js" type="text/javascript"&gt;&lt;/script&gt;
     &lt;script type="text/javascript"&gt;
     $.jgrid.no_legacy_api = true;
     $.jgrid.useJSON = true;
     &lt;/script&gt;  
     &lt;script src="~/Scripts/js/jquery.jqGrid.src.js" type="text/javascript"&gt;&lt;/script&gt;  
    &lt;/head&gt; 
    &lt;body&gt; 
  
     &lt;div class="container body-content"&gt;
      @RenderBody()       
     &lt;/div&gt;
  
     @Scripts.Render("~/bundles/jquery")
     @Scripts.Render("~/bundles/bootstrap")
     @RenderSection("scripts", required: false)
   &lt;/body&gt;
   &lt;/html&gt;
  </code></pre>
  
  <p><strong>Index.cshtml page:</strong></p>
  
  <pre><code> @{
      ViewBag.Title = "Home Page";
    }
  
    &lt;table id="jqGrid" &gt;&lt;/table&gt;
    &lt;div id="pager"&gt;&lt;/div&gt;
  
   &lt;script type="text/javascript"&gt;
      //&lt;![CDATA[
      /*global $ */
      /*jslint browser: true */
     //  $(function () {
     //  "use strict";
        $("#jqGrid").jqGrid({
        url: "GetData.asmx/GetData/LoadData",        
        datatype: "xml",     
        xmlReader: {
        repeatitems: false,           
        root: "Rowset",
        row: "Row"
      },
      colNames: ["Id","Contact Name", "City", "Country"],
      colModel: [
          { name: 'id', index: 'id', width: 40, stype: 'text',sortable:true },
          { name: "ContactName", index: "ContactName", sortable: true, width: 300, search: true, stype: 'text' },
          { name: "City", index: "City", sortable: true, width: 300, search: true, stype: 'text'  },
          { name: "Country", index: "Country", sortable: true, width: 300, search: true, stype: 'text'  }
      ],
      rowNum: 10,
      rowList: [10, 20, 50, 100],
      pager: "#pager",
      gridview: true,
      rownumbers: true,
      viewrecords: true,
      height: "auto",        
      loadonce: true,       
      sortorder: "desc",
      caption: "List of Employees",
      ignoreCase: true        
  }).jqGrid("filterToolbar", { searchOnEnter: false, stringResult: true, defaultSearch: "cn" });
   // });
    //]]&gt;  
    &lt;/script&gt;
  </code></pre>
  
  <p>It shows blank page if  <strong>$(function () {})</strong> is there. If I comment this part, then it shows grid and data on the web-page. But still, toolbar searching does not work.</p>
  
  <p>Please guide me where it's going wrong. </p>