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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T14:48:11+00:00 2026-05-17T14:48:11+00:00

The following json and jqgrid options give me no data in my grid. var

  • 0

The following json and jqgrid options give me no data in my grid.

var grid = jQuery("#grid")[0];
grid.addJSONData({ // the json
    total: 1,
    page: 1,
    records: 10,
    items: [
        { ProductID: '1', Name: 'Coke' },
        { ProductID: '2', Name: 'Pepsi' },
        { ProductID: '3', Name: 'L&P' },
        { ProductID: '4', Name: 'A&B' },
        { ProductID: '5', Name: 'All Star' },
        { ProductID: '6', Name: 'Wai' },
        { ProductID: '7', Name: 'cd' },
        { ProductID: '8', Name: 'LV' },
        { ProductID: '9', Name: 'DD' },
        { ProductID: '10', Name: 'aW' }
    ]
});

// jqGrid options
{
    ...
    colNames: ['ProductID', 'Name'],
    colModel: [{ name: 'ProductID', Label: 'Id' },
               { name: 'Name', Label: 'Name'}],
    jsonReader: {
        root: 'items',
        cell: ''
    },
   ...
}


  • 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-17T14:48:12+00:00Added an answer on May 17, 2026 at 2:48 pm

    Your data has no id properties. It seems that ProductID play the role of id of your data. So you should use additional key:true option in the definition of the ProductID column or include ‘id:ProductID’ in the jsonReader.

    Moreover the Label property should be written in low case: label. It replace the value from the column header colNames. If you use label property for all columns you not need more define colNames array.

    If you want to fill the jqGrid with the local data the most effective way is to use addRowData function. In the case you should use localReader instead of jsonReader. It can be used to add not only a row, but an array of row data. In the case of arrays as data the first parameter should be the name of id property. So your code could look like following:

    var myData = [
            { ProductID: '1', Name: 'Coke' },
            { ProductID: '2', Name: 'Pepsi' },
            { ProductID: '3', Name: 'L&P' },
            { ProductID: '4', Name: 'A&B' },
            { ProductID: '5', Name: 'All Star' },
            { ProductID: '6', Name: 'Wai' },
            { ProductID: '7', Name: 'cd' },
            { ProductID: '8', Name: 'LV' },
            { ProductID: '9', Name: 'DD' },
            { ProductID: '10', Name: 'aW' }
        ];
    jQuery("#grid").jqGrid ('addRowData', 'ProductID', myData);
    

    If all this will not help, you should include in your question the whole code which can be used to reproduce your problem.

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

Sidebar

Related Questions

I have a simple grid with the following options: jQuery(#mygrid).jqGrid({ url: 'dataurl.htm', datatype: 'json',
jqGrid takes the following JSON format: { total: 5, page: 2, records: 55, rows
i have the following code on my aspx page: jQuery(#listFondos).jqGrid({ url: '/PorMyController/LoadGridData/', datatype: 'json',
I have the following call to load a grid: $(#searchlist).jqGrid({ url:'./searchlibrary', datatype: 'json', mtype:
I have html page consisting of JqGrid. JqGrid is bind through JSon data. There
I m new about JqGrid. I use following code to grid my data: <script
I have the following grid: $(function(){ $(#poGrid).jqGrid({ url:'URL', datatype: 'json', mtype: 'GET', colNames:[], pager:
I have the following json object. var json1 = {00 : 00, 15 :
Given the following JSON data: [ { pk: 2, model: corkboard.announcement, fields: { body:
I have the following JSON { data: { status: 200, message: OK, text: Succesvol

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.