Note that there are some explanatory texts on larger screens.

plurals
  1. POLoading JSON data in jqGrid
    primarykey
    data
    text
    <p>I'm having troubles when showing my json data in jqGrid.</p> <p>I've searched a lot in this forum and tried various forms to make it work. I apologize if this was already answered but I really need help with this one.</p> <p>At the server page I was only using <strong>JavaScriptSerializer</strong> to send the data and the <strong>jsonreader</strong> function with the default parameters (this worked ok).</p> <p>I now need to paginate and have changed my server page code to work with the <strong>sidx</strong>, <strong>sord</strong>, <strong>page</strong>, <strong>rows</strong> parameters.</p> <p>The resulting string from the server looks like this:</p> <pre><code>{"total":"344","page":"1","records":"8577","root":[{"Id":"1","SerialNumber":"132","Name":"ServerName"},...]} </code></pre> <p>Here is my jQuery code:</p> <pre><code>$("#list").jqGrid({ datatype: "json", mtype: 'GET', url:'https://server/handlerpage.ashx', colNames:['Id','SerialNumber','Name'], colModel :[ {name:'Id', index:'Id', jsonmap:"Id", width:20}, {name:'Name', index:'Name', jsonmap:"Name", width:120}, {name:'SerialNumber', index:'SerialNumber', jsonmap:"SerialNumber", width:100}], jsonreader: {repeatitems:false,id:'Id',root:'root'}, pager: '#pager', rowNum:25, rowList:[25,50,75,100], sortname: 'Id', viewrecords:true, gridview: true, height:"400", width:"700", caption: 'Select from existing server', loadtext:'Loading, please wait' }).navGrid("#pager", { edit: false, add: false, search: true, del: false }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload