Forum


08:52

27/08/2008

Hi Tony,
I am getting an error “ts.p.colModel[idn] is undefined”. The datatype I am using is jasonstring and the datastr data I am passing is as follows
var response = "{'page':'1', 'total':1.0,'records':'2','rows':[{'v_id':'5','cell':['mi_adizero','live','mi team jersey mi teamwear shorts']},{'v_id':'2','cell':['mi_teamwear','live','mi team jersey mi teamwear shorts']}]}”
The functiona I am using to build the grid is
jQuery(document).ready(function(){
jQuery(”#list2″).jqGrid({
url:'myurl',
datatype: 'jsonstring',
datastr : response,
colNames:['Id','Name', 'Email', 'Role'],
colModel:[
{name:'v_id',index:'v_id', width:30},
{name:'v_name',index:'v_name', width:150},
{name:'v_email',index:'v_email asc, invdate', width:200},
{name:'v_role',index:'v_role', width:150, align:"right"}
//{name:'tax',index:'tax', width:80, align:"right"},
//{name:'total',index:'total', width:80,align:"right"},
//{name:'note',index:'note', width:150, sortable:false}
],
pager: jQuery('#pager2'),
rowNum:10,
rowList:[10,20,30],
imgpath: 'pathtoimages',
sortname: 'v_id',
viewrecords: true,
sortorder: “desc”,
caption: “Vendor Listing”,
});
});
I would appreciate if you could find out the solution for me.
Thanks and Regards
Ranju
08:54

27/08/2008

idn=(ts.p.keyIndex===false)?ts.p.jsonReader.id:ts.p.keyIndex;drows=data[ts.p.jsonReader.root];if(drows){for(var i=0;i<drows.length;i++){cur=drows[i];row=document.createElement("tr");row.id=cur[idn]||cur[ts.p.colModel[idn].jsonmap]||cur[ts.p.colModel[idn].name]||i+1;if(ts.p.multiselect){addMulti(t,row);gi=1;}
These are the lines that is trigger for this error. Any help is appreciable.
Regards
Ranju
09:05

Moderators
30/10/2007

If I see you should configure jsonReader for your data - the id row
is set to read id:"some_id", by default the this is id
in jsonReader maybe you should set value to "v_id"
i.e. id:"v_id"
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:
71 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