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

  • Home
  • SEARCH
  • 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 603579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:56:46+00:00 2026-05-13T16:56:46+00:00

I am trying to get a grid displayed using jqGrid. Everything seems to work

  • 0

I am trying to get a grid displayed using jqGrid. Everything seems to work fine. The table is being render, but all the cells are empty. All the other infos are on the table (page number, total pages, number of rows). When trying to change page, the json data is being retrieved without any problem.

Here is a snip of my code:

<script type="text/javascript">
$(document).ready(function() {
  $("#list2").jqGrid({
      url:'/ajax/list/facture',
      datatype: "json",          
      colModel:[
       {label:'N° d\'article', name: 'code', width:90},
       {label:'Article', name: 'article', width:100},
       {label:'Entrepôt', name: 'entrepot', width:80, align:"right"},
       {label:'Limite', name: 'limite', width:80, align:"right"},
       {label:'À commander', name: 'qte_a_commander', width:80,align:"right"},
       {label:'Déjà commander', name: 'qte_deja_commander', width:150},
       {label:'Coût', name: 'cout', width:150},
       {label:'Prix', name: 'prix', width:150},
       {label:'Coût total', name: 'cout_total', width:150}
      ],
      rowNum:100,
      scoll: true,
      //rowList:[10,20,30],
      pager: '#pager2',
      //sortname: 'code',
      viewrecords: true,
      sortorder: "desc",
      jsonReader: {
        repeatitems : false,
        id: "0"
      },
      //sortorder: "desc",
      caption:"Inventaire",

      width: 1200,
      height: 200


  });

  $("#list2").jqGrid('navGrid','#pager2',{edit:false,add:false,del:false});


 });


</script>

<table id="list2"></table>
<div id="pager2"></div>

My json data being sent:

{
  "page":"1",
  "total":33,
  "records":"100",
  "rows":[
    {"id":1,"cell":{"code":"0064NB","article":"Livre","entrepot":"4","limite":"3","qte_a_commander":"3","qte_deja_commander":"0","cout":"3.40","prix":"30.99","cout_total":"13.60"}},
    {"id":2,"cell":{"code":"0072NB","article":"Livre et corrig\u00e9","entrepot":"5","limite":"3","qte_a_commander":"3","qte_deja_commander":"0","cout":"3.40","prix":"30.99","cout_total":"17.00"}}
    /*[... got over 100 fields ...]*/
  ]}  
  • 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-13T16:56:47+00:00Added an answer on May 13, 2026 at 4:56 pm

    Well, was able to get it working using index instead of names

      colModel:[
       {label:'Code', index: 'code', width:90},
       {label:'Article', index: 'article', width:100},
       {label:'Entrepôt', index: 'entrepot', width:80, align:"right"},
       {label:'Limite', index: 'limite', width:80, align:"right"},
       {label:'À commander', index: 'qte_a_commander', width:80,align:"right"},
       {label:'Déjà commander', index: 'qte_deja_commander', width:150},
       {label:'Coût', index: 'cout', width:150},
       {label:'Prix', index: 'prix', width:150},
       {label:'Coût total', index: 'cout_total', width:150}
      ],
    

    And by not naming my json data:

    {
      "page":"1",
      "total":33,
      "records":"100",
      "rows":
        [
          {"id":1,"cell":["0064NB","Livre","4","3","3","0","3.40","30.99","13.60"]},
          {"id":2,"cell":["0072NB","Livre corrig\u00e9","5","3","3","0","3.40","30.99","17.00"]}
        ]
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a MVC website and using jqGrid. I have managed to get it
Trying to get radiobuttons binding working but getting a run time error with the
I'm trying to get all the email nodes for the customers in the sample
I'm having a bit of a time trying to get Dojo grids (1.5) to
I am trying to design a template for a TabItem using paths and rectangles.
I am trying to get Hudson to run my ruby based selenium tests. I
I am trying to display different images based on data returned. I am running
I am trying to set twoway binding on a UserControl that I have created.
I'm trying to take a python class (in IronPython), apply it to some data
I have a UserControl with a Template property that I've set up as a

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.