title: jqGrid is loading JSON but not displaying it
body: <p>I have been reading a wide variety of posts and documentation about this issue, and I have tried everything I have read and can think of - still stumped.</p>
  
  <p>I'm trying to load JSON data from the server into a jqGrid in a Dot Net Nuke website. Using DNN is not my choice, so there is no option to not use it. That being said, I've set up a standard DNN website and added a C# class library project (named ApiLibrary) to it. In it, there are two classes:</p>
  
  <p><strong>RouteMapper.cs</strong></p>
  
  <pre><code>using DotNetNuke.Web.Api;
  
  namespace ApiLibrary
  {
      public class RouteMapper : IServiceRouteMapper
      {
          public void RegisterRoutes(IMapRoute mapRouteManager)
          {
              mapRouteManager.MapHttpRoute("ApiLibrary", "default", "{controller}/{action}", new[] { "ApiLibrary" });          
          }
      }
  }
  </code></pre>
  
  <p>and <strong>WelcomeController.cs</strong> which contains my AJAX functions. The one that I am using for the jqGrid is the following:</p>
  
  <pre><code>[WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)]
  public string GetMyData(string sidx, string sord, int page, int rows)
          {
              var myList = GetTransportTable(); // returns List&lt;TransportInfo&gt;
              var rowlist = new List&lt;Row&gt;() { };
              int m = 0;
              for (var i = 0; i &lt; myList.Count; i++)
              {
                  m = i + 1;
                  Row rowobj = new Row();
                  var stringList = new List&lt;string&gt;();
                  rowobj.id = m.ToString();
  
                  stringList.Add(myList[i].Pilot);
                  stringList.Add(myList[i].Vessel);
                  stringList.Add(myList[i].Dock);
                  stringList.Add(myList[i].Amount.ToString("c"));
  
                  rowobj.cell = stringList;
                  rowlist.Add(rowobj);
              }
  
              var jsonToReturn = new
              {
                  total = 3,
                  page = 1,
                  records = myList.Count.ToString(),
                  rows = rowlist.ToArray()
              };
  
  
              string jData = string.Empty;        
              jData = JsonConvert.SerializeObject(jsonToReturn);
  
              return jData;
          }
  </code></pre>
  
  <p>This returns 100% valid JSON (verified on jslint) that is in the format that jqGrid wants - i.e:</p>
  
  <blockquote>
    <p>{
        "total": "4",
        "page": "1",
        "records": "4",
        "rows" : [
            {
                "id": "1", "cell":["Myname", "Myboat", "Mydock", "144"]
            },
            {
                "id": "2", "cell":["Myname1", "Myboat1", "Mydock1", "1414"]
            }
        ] }</p>
  </blockquote>
  
  <p>For each event listed in the jqGrid documentation if do an <code>alert()</code> to display the data during that event then it displays my perfectly formatted JSON. This is telling me that jqGrid is receiving the data just fine, but something is blocking it from displaying the data. </p>
  
  <p>I've tried using jsonReader, jsonmap, and pretty much every other suggestion/option that I've come across.</p>
  
  <p>I have checked and doublechecked my javascript and css references and those are good to go.
  Here is my Javascript for loading the grid:</p>
  
  <pre><code>$("#reviewList").jqGrid({
  
  ajaxGridOptions: { contentType: 'application/json; charset=utf-8' },
  url: 'DesktopModules/ApiLibrary/API/Welcome/GetMyData',
  jsonReader: {
                  repeatitems: false,
                  id: "id",
                  root: "rows",
                  page: "page",
                  total: "total",
                  records: "records",
                  cell: "cell"
              },
  colNames: ['Pilot', 'Vessel', 'Dock', 'Amount'],
  colModel: [
   { name: 'Pilot', width: 250, align: 'center' },
   { name: 'Vessel', width: 250, align: 'center' },
   { name: 'Dock', width: 175, align: 'center' },
   { name: 'Amount', width: 110, align: 'center' }
  ],
  rowNum: 10,
  rowList: [10, 20, 30],
  pager: "#pager2",
  viewrecords: true,
  sortname: 'Pilot',
  sortorder: 'asc',
  caption: 'Transport List Overview'
  
   }).navGrid("#pager2", { edit: false, add: false, del: false });
  </code></pre>
  
  <p>It's worth noting that I have used several other AJAX calls with jQuery (both GET and POST) on the same page and have had no issues with parsing any JSON. Also, with that JSON (from jQuery AJAX calls outside of jqGrid) I can display it in jqGrid. However, since it is local data, I can't sort/page/search it - that's no good for me.</p>
  
  <p>What is going wrong? </p>