Forum


13:46

28/01/2010

Hi all,
I've linked up my question with this post - http://www.trirand.com/blog/?p.....undefined/ . But getting a little impatient and worried that people might not look at older posts. Can you please tell me what's wrong with this json and this jsonreader? For some reason i'm not able to populate the grid with actual data although i have the correct number of rows.
my json looks like this and is a valid json
{
"records": 4,
"total": 5,
"rows": [
{
"cell": {
"lastname": "V",
"_type": "User",
"uid": "u11",
"firstname": "Megha"
}
},
{
"cell": {
"lastname": "V",
"_type": "User",
"uid": "u12",
"firstname": "Prashant"
}
},
{
"cell": {
"lastname": "A",
"_type": "User",
"uid": "u1",
"firstname": "Shalini"
}
},
{
"cell": {
"lastname": "V",
"_type": "User",
"uid": "u0",
"firstname": "Megha"
}
}
]
}
This is my grid description -
$(document).ready(function(){
// This is a basic jqGrid with a navGrid (that adds a search button)
jQuery('#list').jqGrid({
url:'/user/get_users/',
datatype: "json",
colNames: ['First Name','Last Name','UID'],
colModel: [{
name: 'firstname',
index: 'firstname'
}, {
name: 'lastname',
index: 'lastname'
}, {
name: 'uid',
index: 'uid asc, invdate'
}],
jsonReader : {
root: "rows",
page: "page",
total: "total",
records: "records",
repeatitems: false,
cell: "cell",
id: "id",
userdata: "userdata",
},
rowNum:10,
rowList:[10,20,30],
multiselect: false,
width: 700,
height: 100,
pager: jQuery('#pager'),
sortname: 'uid',
viewrecords: true,
sortorder: "asc",
caption: "Users"
}).navGrid("#pager",{edit:false,add:false,del:false},{},{width:200},{});
});
13:55

28/01/2010

oops! Got it here - http://www.trirand.com/blog/?p.....-notation/
Ignore me!
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