I have a problem with my program as I want to access data from my website. The data is published by a REST server. I do get the data but it is not showing up. Here is an example of the JSON data:
{"Data":[{"Uid":1,"age":30,"cedula":54689,"lastName":"kumar","mail":"algo@ailfs","name":"Sam"},{"Uid":2,"age":35,"cedula":123589,"lastName":"kumar","mail":"lndsfkl@kjnnf","name":"Ram"},{"Uid":3,"age":39,"cedula":8453,"lastName":"Perez","mail":"sdbfk@kgmial","name":"Sam"},{"Uid":4,"age":56,"cedula":87956216,"lastName":"Perez","mail":"kav@gamil.com","name":"Pepe"},{"Uid":5,"age":72,"cedula":849666,"lastName":"Mujica","mail":"pepe@gmail.com","name":"Pepe"},{"Uid":6,"age":25,"cedula":10565896,"lastName":"Aughburn","mail":"jkd@gmail","name":"Rosh"}],"Page":1,"PageSize":6,"TotalPages":2}
and my jqgrid code:
jQuery("#jQGridDemo").jqGrid({
url: myurl,
datatype: "jsonp",
mtype: "GET",
ajaxGridOptions: { contentType: 'application/json; charset=utf-8' },
jsonReader: {
root: "Data",
page: "Page",
total: "TotalPages",
records: "PageSize",
repeatitems: true,
cell: "",
id: "0"
},
colNames: ['Id', 'Nombre', 'Apellido', 'Edad', 'Cedula',
'Email'],
colModel: [
{ name: 'Uid', index: 'Uid', width: 20 },
{ name: 'name', index: 'name', width: 150 },
{ name: 'lastName', index: 'lastName', width: 150 },
{ name: 'age', index: 'age', width: 120 },
{ name: 'cedula', index: 'cedula', width: 60 },
{ name: 'mail', index: 'mail', width: 200, sortable: false },
],
rowNum: 5,
rowList: [2, 5, 10],
sortname: 'Id',
loadonce: true,
viewrecords: true,
ignoreCase: true,
sortorder: "desc",
caption: "Usuarios del Sistema",
loadError: function (xHr, status, error) { alert(error);}
});
I put the loadError function in and it says soething like "error: jQuery111045... was not called"
Thanx for any help.