Note that there are some explanatory texts on larger screens.

plurals
  1. POjqGrid is empty with JSON call
    primarykey
    data
    text
    <p>My jqGrid is coming empty with JSON call. Though it is working with datatype='jsonstring' but not with json type. here is my JSON </p> <pre class="lang-json prettyprint-override"><code>{ "d": { "total": 6, "page": 1, "records": 6, "rows": [ { "id": 1, "Name": "James", "EMPID": "0000000056", "EMPDATE": "", "JOBTYPE": "REQ", "DEPTID": "FIN", "STATUS": "P1" }, { "id": 2, "Name": "James", "EMPID": "R2", "EMPDATE": "", "JOBTYPE": "REQ", "DEPTID": "FIN", "STATUS": "P1" }, { "id": 3, "Name": "James", "EMPID": "V2", "EMPDATE": "", "JOBTYPE": "VOU", "DEPTID": "FIN", "STATUS": "" }, { "id": 4, "Name": "James", "EMPID": "V1", "EMPDATE": "", "JOBTYPE": "VOU", "DEPTID": "FIN", "STATUS": "" }, { "id": 5, "Name": "James", "EMPID": "009017", "EMPDATE": "", "JOBTYPE": "PY", "DEPTID": "", "STATUS": "V2" }, { "id": 6, "Name": "James", "EMPID": "009018", "EMPDATE": "", "JOBTYPE": "PY", "DEPTID": "", "STATUS": "V1" } ] } } </code></pre> <p>and my jqGrid call from javascript is</p> <pre class="lang-js prettyprint-override"><code>function getgrid() { $("#list").jqGrid({ url:'http://10.240.26.41/GetGridFields', datatype: 'json', mtype: 'GET', ajaxGridOptions: { contentType: 'application/json; charset=utf-8' }, //serializeGridData: function (postData) { // return JSON.stringify(postData); // }, jsonReader: { repeatitems: false, root: "d.rows", page: "d.page", total: "d.total", records: "d.records" }, colModel: [ { name: 'id', key: true, width: 60, align: "center", hidden: false }, { name: 'Name', width: 80, sortable: false, hidden: false }, { name: 'EMPID', width: 180, sortable: false, hidden: false }, { name: 'EMPDATE', width: 180, sortable: false, hidden: false }, { name: 'JOBTYPE', width: 180, sortable: false, hidden: false }, { name: 'DEPTID', width: 180, sortable: false, hidden: false }, { name: 'STATUS', width: 180, sortable: false, hidden: false } ], rowNum: 10, rowList: [10, 20, 300], pager: "#pager", viewrecords: true, gridview: true, rownumbers: true, height: 230, caption: 'Emp Detail' }) } </code></pre> <p>Please let me know where i am wrong here. It is working fine with jsonstring.</p>
    singulars
    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