I have the following setup for a jQgrid:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
$(function () { $("#grid").jqGrid({ url: '/sf/api-logs', datatype: "json", colModel: [ {"index": "id", "name": "ID", "width": 100}, {"index": "errorMessage", "name": "Error Message", "width": 100}, {"index": "dataSource", "name": "Source", "width": 100}, {"index": "dataTarget", "name": "Target", "width": 100}, {"index": "integrationStatus", "name": "Status", "width": 100}, {"index": "brand", "name": "Brand", "width": 100}, {"index": "recordCount", "name": "Record Count", "width": 100}, {"index": "inserted", "name": "Inserted", "width": 100}, {"index": "updated", "name": "Updated", "width": 100}, {"index": "failed", "name": "Failed", "width": 100}, {"index": "noAction", "name": "No Action", "width": 100}, {"index": "createdAt", "name": "Created At", "width": 100}, {"index": "updatedAt", "name": "Updated At", "width": 100} ], width: 980, height: 300, pager: "#gridpager", toppager: true, hoverrows: true, shrinkToFit: true, autowidth: true, rownumbers: true, viewrecords: true, rowList: [10, 20, 50, 100], data: [], rownumWidth: 50, sortable: true, jsonReader: { root: 'rows', page: 'page', total: 'total', records: 'records', cell: '', repeatitems: false }, loadComplete: function (data) { if (data.records === 0) { $("#load_grid").addClass("info_msg").html($("<span>", { "class": "grid-empty", "text": "No results were found." })).delay(800).fadeIn(400); } } }); }); |
And this is the data I am receiving as a response from the server side:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
{ "total": 17, "page": 1, "records": 17, "rows": [ { "id": "59038f9f7661ae00e745aca3", "dataSource": "SomeDataSource", "errorMessage": null, "dataTarget": "SomeDataTarget", "integrationStatus": true, "brand": "SomeBrand", "recordCount": 11, "inserted": 0, "updated": 0, "noAction": 0, "failed": null, "createdAt": null, "updatedAt": null }, { "id": "59076c2677336500a1427092", "dataSource": "SomeDataSource", "errorMessage": [ "cURL error 60: SSL certificate problem: certificate has expired (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)" ], "dataTarget": "SomeDataTarget", "integrationStatus": true, "brand": "SomeBrand", "recordCount": null, "inserted": null, "updated": null, "noAction": null, "failed": null, "createdAt": null, "updatedAt": null }, ... ] } |
But the grid isn’t displaying the data and I can’t find where the problem is coming from. I haven’t any issues with Javascript or so on meaning the browser console is clean. Any ideas? What I am missing here?
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top