Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6535517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:22:58+00:00 2026-05-25T10:22:58+00:00

I’m using asp.net mvc to create a webpage that renders a jqGrid for data

  • 0

I’m using asp.net mvc to create a webpage that renders a jqGrid for data in my azure table. The grid will callback into my controller and using the debugger, I can visually verify data is being generated correctly. The issue is that once the data is returned as a JSON string, the jqGrid throws this error:

b.jgrid.getAccessor(p, d.cell) is undefined
http://localhost:54758/jquery.jqGrid.min.js
Line 65

I’ve looked online for documentation but have been unsuccessful in returning anything except what appears to be repository snapshots. I’ve stripped down my code to only have one column of data (shown below) returned as a string and still nothing.

If I add the line “datatype: ‘local’,” to my jqGrid options, the error isn’t thrown. However, data is still not being rendered either. None of the other questions suggested in “Similar Questions” solved my issue. The data is just an Id field and is a simple C# string.

Below is the aspx file contents used to render the jqGrid:

<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">  
<%--Must load language tag BEFORE script tag--%>
<script src="grid.locale-en.js" type="text/javascript"></script>
<script src="jquery.jqGrid.min.js" type="text/javascript"></script>

<script type="text/javascript">
    jQuery(document).ready(function () {
        jQuery("#list").jqGrid({
            autowidth: true,
            url: '/HouseData/GridData/',
            datatype: 'local',  <---instead of 'local' I also tried 'jsonstring'
            mtype: 'POST',
            colNames: ['House Name'],
            colModel: [
                { name: 'houseName', index: 'houseName', key: true, width: 80, align: 'right', hidden: false }],

            pager: jQuery('#pager'),
            rowNum: 20,
            rowList: [5, 10, 20, 50],
            sortname: 'houseName',
            sortorder: "desc",
            height: 400,
            viewrecords: true,
            imgpath: ''
       });
    });

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<div id="main">
    <h2><a href="#">Show House Name</a></h2> 
    <div class="disignBoxFirst">
        <div class="boxContent">
                <%: Html.Partial("HouseDataSearch") %>
        </div>
    </div>
    <hr />
    <table id="list" class="scroll" cellpadding="0" cellspacing="0"></table>
    <div id="pager" class="scroll" style="text-align:center;"></div> 
</div>
</asp:Content>

The function used to compose the json string, contained in the C# file “HouseDataController.cs”, is below (initially I didn’t have the “datatype” option in the aspx file shown above for the jqGrid):

public JsonResult GridData(string sidx, string sord, int page, int rows, string houseName)
    {            
        //Setup values to return to the view for display of user entered values            
        ViewData["HouseName"] = houseName;


        //Get table data
        CloudStorageAccount storageAccount = CloudStorageAccount.FromConfigurationSetting("ConnectionString");
        ReportStorageDataServiceContext storageContext = new ReportStorageDataServiceContext(storageAccount.TableEndpoint.ToString(), storageAccount.Credentials);

        int houseCount = 0;
        IQueryable<HouseDataModel> houses = storageContext.CreateQuery<HouseDataModel>("HouseDataTable").Where(h => h.isAvailable == true);
        List<HouseDataModel> queryDetails = new List<HouseDataModel>();
        foreach (HouseDataModel house in houses)
        {
            queryDetails.Add(house);
            houseCount++;
        }

        //Figure out paging
        int pageIndex = Convert.ToInt32(page) - 1;
        int pageSize = rows;
        int totalRecords = houseCount;
        int totalPages = (int)Math.Ceiling((float)totalRecords / (float)pageSize);

        var jsonData = new
        {
            total = totalPages,
            page,
            records = totalRecords,
            rows = (from house in queryDetails select new { User = house.houseName }).ToArray()
        };

        return Json(jsonData);
    }

The error message was caught using Firebug. If this is not specific/detailed enough or if it was resolved in another thread please advise.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:22:58+00:00Added an answer on May 25, 2026 at 10:22 am

    Try this:

     jQuery("#list").jqGrid({
                autowidth: true,
                url: '/HouseData/GridData/',
                datatype: 'local',  <---instead of 'local' I also tried 'jsonstring'
                mtype: 'POST',
                colNames: ['House Name'],
                colModel: [
                    { name: 'houseName', index: 'houseName', key: true, width: 80, align: 'right', hidden: false }],
    
                pager: jQuery('#pager'),
                rowNum: 20,
                rowList: [5, 10, 20, 50],
                sortname: 'houseName',
                sortorder: "desc",
                height: 400,
                viewrecords: true,
                imgpath: '',
                jsonReader : {
                    root: "rows",
                    page: "page",
                    total: "total",
                    records: "records",  
                    repeatitems: false,
                    cell: "cell",
                    id: "id",
                    userdata: "userdata",    
                   },           
           });
    

    I added the jsonReader part. I had the same problem and this seems to fix it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I'm trying to create an if statement in PHP that prevents a single post
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.