Forum

July 12th, 2025
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
problem with repeatitems json data
26/11/2009
05:37
Avatar
Jörg Erdmenger
Guest
Guests

Hi all, I'm having some problems with using objects/map rather than arrays for my cell data. I've followed the docs closely but I can't get it to work. I use jqGrid 3.6.1.

If I do this:

jQuery("#currentCompoundsGrid").jqGrid({

datatype: 'jsonstring',

     datastr: '{total: "1", page: "1", records: "1", rows: [{id:"1", cell:["Tester", "K47"]}]}',

     jsonreader: {

   repeatitems: true

     },

colNames:['Tester', 'Ki'],

colModel:[

{name:'Tester', width:400},

{name:'Ki', width:200}

],

viewrecords: true,

caption:"Aktuelle Compounds"

}); 

all is well, but if I do that:

jQuery("#currentCompoundsGrid").jqGrid({

datatype: 'jsonstring',

     datastr: '{total: "1", page: "1", records: "1", rows: [{id:"1", Tester:"Tester", Ki:"K47"}]}',

     jsonreader: {

     repeatitems: false,

     cell: "",

     id: "0"

     },

colNames:['Tester', 'Ki'],

colModel:[

{name:'Tester', width:400},

{name:'Ki', width:200}

],

viewrecords: true,

caption:"Aktuelle Compounds"

});

The Grid keeps saying 'Loading' and I get a 'cur is undefined' error in my Firefox error console. I have tried leaving the cell and id jsonreader params, setting id to "0", even putting in a 'cell' element that contains the map of values - no luck.

Can anybody shed some light onto this? I'd really appreciate this to work as some of my data rows might end up containing not all data which means the positional array stuff will break eventually.

27/11/2009
05:15
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

You should set jsonReader instead of jsonreader

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 994

Currently Online:
46 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