Forum


00:43

18/06/2009

Hi, I am unable to get my grid to show up. Here is what I have in my html file, (I'm trying to integrate with django).
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("#list").jqGrid({
url:'/dashboardJSON/',
datatype: "json",
colNames:['Recipient','Date Created', 'Date', 'Value','Status'],
colModel:[
{name:'recipient', index:'recipient', width:100, jsonmap:"fields.recipient"},
{name:'createdate', index:'createdate', width:90, jsonmap:"fields.date_created"},
{name:'date', index:'date', width:90, jsonmap:"fields.date"},
{name:'value', index:'value', width:80, align:"right", jsonmap:"fields.value"},
{name:'status', index:'status', width:10, jsonmap:"fields.status"}
],
jsonReader: {
root: "rows",
id: "pk",
page: "currpage",
total: "totalpages",
records: "totalrecords",
cell: "fields",
repeatitems: true,
},
rowNum:5,
rowList:[5,10,25],
imgpath: "/static/css/jqgrid-theme/basic/images",
pager: jQuery('#pager'),
sortname: 'date',
viewrecords: true,
sortorder: "asc",
caption: "Upcoming Awards",
});
});
</script>
and my JSON file:
{
"totalpages": 2,
"currpage": 2,
"totalrecords": 10,
"rows": [
{
"pk": 15,
"model": "awards.award",
"fields": {
"date": "2009-06-18",
"date_created": "2009-06-17",
"status": 1,
"recipient": 5,
"value": 2
}
},
{
"pk": 18,
"model": "awards.award",
"fields": {
"date": "2009-06-18",
"date_created": "2009-06-17",
"status": 1,
"recipient": 6,
"value": 4
}
}
]
}
What am I doing wrong? What js files must I include in the html file? Thanks in advance!
05:44

Moderators
30/10/2007

Hello,
If you use 3.5 check the install.txt, if you use 3.4 check the installition notes in the documentation page.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
53 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