Forum
November 2nd, 2014
A
A
A
The forums are currently locked and only available for read only access
Topic RSS
Related Topics
Need help with json data source
22/07/2013
05:06
05:06
jgalak
Member
Members
Forum Posts: 7
Member Since:
22/07/2013
22/07/2013
Offline
I'm very new to PHP/JavaScript/JQuery/JQGrid, so please bear with me.
I'm trying to set up a very basic grid, just to test how things work.
Here's my grid definition:
<script src="http://192.168.1.70/phils/jsgr.....9.0.min.js" type="text/javascript"> </script> <script src="http://192.168.1.70/phils/jsgr.....cale-en.js" type="text/javascript"></script> <script src="http://192.168.1.70/phils/jsgr.....rid.min.js" type="text/javascript"></script> <script type="text/javascript"> $(function() { $("#list").jqGrid( { url: "http://192.168.1.70/phils/js", dataype: "json", mtype: "GET", colNames: ["username", "email"], colModel: [ {name: "username"}, {name: "email"}, ], pager: "#pager", rowNum: 10, rowList: [10, 20, 30], sortname: "id", sortorder: "desc", viewrecords: true, gridview: true, autoencode: true, caption: "My first grid" }); }); </script> </head> <body> <table id="list"><tr><td></td></tr></table> <div id="pager"></div> </body> </html>
Here's the json (achieved by going to http://192.168.1.70/phils/js directly):{
"total":"1",
"page":"1",
"records":"2",
"rows":[
{"id":"1","cell":["test1","test@test.com"]},
{"id":"2","cell":["test2","test@test.com"]}
]}
Firefox' web console gives the error "[22:03:18.521] not
well-formed @ http://192.168.1.70/phils/jq:1" (thats the file with the grid)
Firebug gives the error "H is undefined Line 2" in jqery-1.9.0.min.js
I've checked and the return type of the json is "application/json".
The grid comes up, but contains no data. Any advice greatly appreciated.
Forum Timezone: Europe/Sofia
Most Users Ever Online: 715
Currently Online:
32 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66