Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
jqGrid issue - ts.p.colModel[idn] is undefined
27/08/2008
08:52
Avatar
ranjuvs
Member
Members
Forum Posts: 7
Member Since:
27/08/2008
sp_UserOfflineSmall Offline

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

27/08/2008
08:54
Avatar
ranjuvs
Member
Members
Forum Posts: 7
Member Since:
27/08/2008
sp_UserOfflineSmall Offline

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

27/08/2008
09:05
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

27/08/2008
23:27
Avatar
ranjuvs
Member
Members
Forum Posts: 7
Member Since:
27/08/2008
sp_UserOfflineSmall Offline

Thank You Tony. It worked for me.

Regards

Ranju

tony said:

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


Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
29 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information