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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T23:32:39+00:00 2026-05-28T23:32:39+00:00

Hello I have an example that works properly: $(function() { $(#treegrid).jqGrid({ url: ‘tree2.json’, datatype:

  • 0

Hello I have an example that works properly:

   $(function() { 
      $("#treegrid").jqGrid({ 
          url: 'tree2.json', 
          datatype: 'json', 
          mtype: 'GET', 
          colNames: ["ID", "Description", "Total"], 
          colModel: [{ 
              name: 'id', 
              index: 'id', 
              width: 1, 
              hidden: true, 
              key: true 
          }, { 
              name: 'desc', 
              index: 'desc', 
              hidden: false, 
              sortable: true 
          }, { 
              name: 'num', 
              index: 'num', 
              hidden: false, 
              sortable: true 
          }], 
          height: 'auto', 
          width: '500', 
          pager: "#ptreegrid", 
          caption: "Tree Grid Example" 
      }) 
  }); 

JSON data

{ 
    "page": 1, 
    "total": 1, 
    "records": 2, 
    "rows": [ 
       {"id": 1, "cell": ["1", "Source 1", "300"]}, 
       {"id": 2, "cell": ["2", "Source 2", "100"]}
    ] 
} 

How to order jqGrid to read this type of JSON data? Is it possible?

{ 
    "page": 1, 
    "total": 1, 
    "records": 2, 
    "rows": [ 
       {"id": 1, "cell": {"id":"1", "desc":"Source 1", "num":"300"}}, 
       {"id": 2, "cell": {"id":"2", "desc":"Source 2", "num":"100"}}
    ] 
} 

That is all
Don’t read next lines

Sorry, this is some text to go through alerts:)
Oops! Your question couldn’t be submitted because:

Your post does not have much context to explain the code sections; please explain your scenario more clearly.

================
Thanks fo help
My final version is taken from your answers too

          jsonReader: {
              repeatitems: false,
          root: function (obj) { return obj; },
          page: function (obj) { return 1; },
          total: function (obj) { return 1; },
          records: function (obj) { return obj.length; }                  
          }

And I’ve changed JSON data

[ 
    {"id":"1", "desc":"Source 1", "num":"300"}, 
    {"id":"2", "desc":"Source 2", "num":"100"}
]

Thanks a lot!!!

  • 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-28T23:32:40+00:00Added an answer on May 28, 2026 at 11:32 pm

    Probably you mean the format of data:

    { 
        "page": 1, 
        "total": 1, 
        "records": 2, 
        "rows": [ 
           {"id":"1", "desc":"Source 1", "num":"300"}, 
           {"id":"2", "desc":"Source 2", "num":"100"}
        ] 
    }
    

    without duplication of id and the unneeded cell property. To read the data you need include jsonReader: {repeatitems: false} option of jqGrid (see the documentation).

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

Sidebar

Related Questions

I have a simple WebView-based activity that follows the Hello, WebView example to enable
Say for example I have the following string: var testString = Hello, world; And
I have a ruby file as follows: module Example class Myclass def t_st Hello
I have a string as const char *str = Hello, this is an example
Hello i have a website in Sharepoint that is using variations. I have for
Hello I have a php code which by echo calls the javascript function expand(txt)
Hello i have implemented photo slideshow with scrollview and imageview using apple's scrolling example
To use a simplified example, I have: $str = Hello :special_text:! Look, I can
Hello I have the following error by git-fsck, which cannot be cleaned by git-gc
Hello we have an SQL server application running over a low bandwith connection. We

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.