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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:25:17+00:00 2026-05-28T03:25:17+00:00

This is my first attempt with JQgrid and I am confused from the documentation

  • 0

This is my first attempt with JQgrid and I am confused from the documentation as to if I need the jsonmap attribute with in my colmodel. As of now I’m getting all of the data but from firebug I see that all I’m getting in each col is:

<td aria-describedby="list_MEMBERID" title="" style="" role="gridcell">&nbsp;</td>

Could someone explain what I am doing wrong exactly?

The Json:

{
"ROWS": [
    {
        "ID": 508,
        "CELLS": {
            "PHONE": "847-382-8872",
            "STATE": "IL",
            "ZIP": 60010,
            "NAME": "Norton's U.S.A.",
            "DESC": "We sell only products made in the United States!We offer an eclectic mix of common household items from toys to tools, glassware to garden supplies, fashions to food and so much more.  When you shop at Norton's U.S.A, you help keep America working!  ",
            "CITY": "Riverwoods",
            "ADDR": "400 Lageschulte Street"
        }
    }
],
"PAGE": 1,
"RECORDS": 1,
"TOTAL": 1
}

The Javascript:

$(function(){ 
  $("#list").jqGrid({
    url:'cfc/buildData.cfc?method=getDining',
    datatype: 'json',
    mtype: 'GET',
    colNames:['Member ID','Member Name', 'Address','City','Zip Code','State', 'Phone', 'Description'],
    colModel :[ 
      {name:'MEMBERID', index:'MEMBERID', jsonmap:'MEMBERID', width:60}, 
      {name:'NAME', index:'NAME', jsonmap:'NAME', width:90}, 
      {name:'ADDR', index:'ADDR', jsonmap:'ADDR', width:80, align:'right'},
      {name:'CITY', index:'CITY', jsonmap:'CITY', width:80, align:'right'}, 
      {name:'ZIP', index:'ZIP', jsonmap:'ZIP', width:80, align:'right'},
      {name:'STATE', index:'STATE', jsonmap:'STATE', width:80, align:'right'},
      {name:'PHONE', index:'PHONE', jsonmap:'PHONE', width:80, align:'right'},  
      {name:'DESC', index:'DESC', jsonmap:'DESC', width:200, sortable:false} 
    ],
    pager: '#pager',
    rowNum: 10,
    rowList:[10,20,30],
    sortname: 'MEMBERID',
    sortorder: 'desc',
    viewrecords: true,
    gridview: true,
    caption: 'Lake County Members',

    jsonReader : {
       root: "ROWS",
       page: "PAGE",
       total: "TOTAL",
       records: "RECORDS",
       repeatitems: true,
       cell: "CELLS",
       id: "MEMBERID",
       subgrid: {root:"ROWS", 
          repeatitems: true, 
          cell:"CELLS"
       }
     }

  }); 
});
  • 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-28T03:25:17+00:00Added an answer on May 28, 2026 at 3:25 am

    The documentation about jsonReader and jsonmap is really difficult for the first reading.

    The most important property of the jsonReader is repeatitems. Default value is repeatitems: true. It means that the format of the rows of data in the JSON should be

    {"id" :"1", "cell": ["cell11", "cell12", "cell13"]}
    

    It’s important to mention that the cell property should has array of strings as the value. The jsonmap property of the colModel will be ignored.

    If you would just use jsonReader: {repeatitems: true} you would overwrite only one property of the default jsonReader. So the format of the data which represent the row in the JSON input should be

    {"id": "abc", "col1": false, "col3": 123, "col2": "cell12"}
    

    In the case no cell property should be used in the input. The data for the column will be identified by name instead of by position in the cell array. The property name col1, col2, col3 can be either from the name property of colModel or from the jsonmap if it’s defined.

    In case of more complex format of input like

    {"id": "abc", "col1": false, "coordinates": {"x": 123, "y": "cell12"}}
    

    you can define for the x column jsonmap: coordinates.x and for the y column jsonmap: coordinates.y.

    In case of your example I would recommend you to change format of the JSON data to

    {
        "ROWS": [
            {
                "ID": 508,
                "PHONE": "847-382-8872",
                "STATE": "IL",
                "ZIP": 60010,
                "NAME": "Norton's U.S.A.",
                "DESC": "We sell only products made in the United States!We offer an eclectic mix of common household items from toys to tools, glassware to garden supplies, fashions to food and so much more.  When you shop at Norton's U.S.A, you help keep America working!  ",
                "CITY": "Riverwoods",
                "ADDR": "400 Lageschulte Street"
            }
        ],
        "PAGE": 1,
        "RECORDS": 1,
        "TOTAL": 1
    }
    
    • to remove 'MEMBERID' from the column model because you don’t included any data in the JSON input.
    • remove sortname: 'MEMBERID' or change it to some existing columns.
    • remove all jsonmap properties

    The jsonReader should be used as

    jsonReader : {
         root: "ROWS",
         page: "PAGE",
         total: "TOTAL",
         records: "RECORDS",
         repeatitems: false,
         id: "ID",
     }
    

    The value of ids of the rows of the grid (the ids for <tr> elements of the table) will be get from the 'ID' property of the JSON input. You should be careful with the values for the ids: there must be unique on the whole page.

    After the above changes the grid will display the data: see the demo. I added height: 'auto' parameter only to reduce the size of unneeded space in the grid.

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

Sidebar

Related Questions

This is my first attempt at using the Google Data API, and I'm getting
First of all, this is my first attempt at a silverlight app and it's
This is my first attempt on semaphores and threads. I constructed this code from
First, let me just mention that this is my first attempt at a from-the-ground-up
This is my first attempt to create a basic list (i need this at
This is my first attempt at asp.net and webforms, windowsforms, all of it. I
This is my first attempt to throw data back and forth between a local
this if my first attempt at using streaming for WCF, and I am struggling
Because this is my first attempt at an extension method that seems quite useful
This is pretty strange (admitedly, this is my first attempt with python / sqlite),

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.