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 7924295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T17:41:24+00:00 2026-06-03T17:41:24+00:00

I have been trying to render JSON data in a JQGrid. I get the

  • 0

I have been trying to render JSON data in a JQGrid. I get the following error:

Error: b is undefined
Source File: http://localhost:1302/Scripts/jquery.jqGrid.min.js
Line: 23

When I use the un-minimized JQGrid source code I see that it makes multiple calls to the getAccessor method and on the last call the first parameter to the method (obj) is passed an undefined value:

Error: obj is undefined
Source File: http://localhost:1302/Scripts/jquery.jqGrid.src.js
Line: 151

That seems to be what’s causing the grid to stop rendering, but why?

The rendered grid shows the column headings but the no contents. The “Loading…” message in the grid never disappears.

My JSON data look like this:

{
   "total":"1",
   "page":"1",
   "userdata":{

   },
   "records":"2",
   "rows":[
      {
         "DateOfBirth":"11/04/2012 12:00:00 AM",
         "DisambiguationNote":"Boring guy",
         "FirstName":"Joe",
         "LastName":"Bloggs",
         "MiddleName":"Binkie",
         "PersonId":"1"
      },
      {
         "DateOfBirth":"01/01/2001 12:00:00 AM",
         "DisambiguationNote":"someone else",
         "FirstName":"Edna",
         "LastName":"Edwards",
         "MiddleName":"Edith",
         "PersonId":"8"
      }
   ]
}

My grid code looks like this:

$(function () {
    $("#persongrid").jqGrid({
        url: '/Person/List',
        datatype: 'json',
        mtype: 'GET',
        jsonreader: {
            root: "rows",
            page: "page",
            total: "total",
            records: "records",
            repeatitems: false,
            id: "5"  ,
            cell: ""  ,
            userdata: "userdata"
        },
        colModel: [
            { name: 'DateOfBirth', index: 'DateOfBirth',sorttype:'date' },
            { name: 'DisambiguationNote', index: 'DisambiguationNote' },
            { name: 'FirstName', index: 'FirstName' },
            { name: 'LastName', index: 'LastName' },
            { name: 'MiddleName', index: 'MiddleName' },
            { name: 'PersonId', index: 'PersonId',sorttype:'int' }
        ],
        pager: '#persongridpager',
        rowNum: 10,
        rowList: [10, 20, 30],
        viewrecords: true,
        gridview: true,
        caption: 'People'
    });
});

I can see that the JSON data is being retrieved as above from the AJAX request, and I have been through the JSON data instructions for JQGrid quite carefully but can’t see what I’m doing wrong.

Can anyone help? Thank you.

  • 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-06-03T17:41:27+00:00Added an answer on June 3, 2026 at 5:41 pm

    The error is very easy, but it’s difficult to find: you use jsonreader instead of jsonReader and so the jsonreader will be ignored and the default jsonReader will be used.

    How you can see on the demo the data will be successfully read after the modification.

    By the way, you can specify only the properties of jsonReader which are different from defaults and use

    jsonReader: {
        repeatitems: false,
        id: "5",
    }
    

    or

    jsonReader: {
        repeatitems: false,
        id: "PersonId",
    }
    

    I added to the demo height: 'auto' option only to improve the visibility.

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

Sidebar

Related Questions

I have been trying all afternoon to get the jQuery Sifr Plugin ( http://jquery.thewikies.com/sifr/
I have been trying to serialize some json data in Silverlight. I am using
I have been trying to find out why the following lines of code do
I have been trying pretty much everything to get my live wallpaper to stop
I have been trying to parse Json into A ListView but when i do
I have been trying for several hours now to get sorl-thumbnail working, but it
I am using django-voting package and have been trying to get it's manager get_top()
I've been trying to get the Grid as Subgrid feature working and have not
Have have been trying to make a validator for my xml files. I have
I have been trying very hard to achieve rounded corners with IE6+jquery ui tabs.

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.