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
Unable to load JSON data retrieve from the server !
08/03/2010
16:58
Avatar
aphilippe
Ivory Coast, West Africa
Member
Members
Forum Posts: 6
Member Since:
08/03/2010
sp_UserOfflineSmall Offline

Hi everybody,

   i'm new with jqQuery and i'm not able to load data in json format. Here is the structure of my json data :

{ persons :
     { persons :
         [ { id : 001 , name : toto },
           { id : 002 , name : titi },
           { id : 003 , name : tata },
           { id : 004 , name : tete }
         ]}
  }

So, i've tried to use the property jsonReader like this :

jsonReader: {
      root:"persons>persons",
      repeatitems:true,
      id: "0"
}

I'm using firebug and jquery-1.3.2.
  There is no errors when the page is loaded but there is nothing in my grid.
  I'm retrieve data directly from the server without the chance to manipulate the reponse. Please help me.

I give you my whole javascript code :

$(document).ready(function() {
            console.log("Trace begin");
            $("#list").jqGrid({
                 url:'http://'+ipserveur+'/services/persons/list',
                 datatype: "json",
                 mtype: 'GET',
                  colNames:['Id','Name'],
                  colModel:[
                            {name:'id',index:'id', width:55},
                            {name:'name',index:'name', width:90},
                            ],
                 viewrecords: true,
                 sortorder: "desc",
                 jsonReader: { root:"persons>persons", repeatitems:true, id: "0"},
                 imgpath: 'themes/basic/images',
                 caption:"Persons Listing", height: 200, width : 700 });
            console.log("Trace End");
           $("#list").jqGrid('navGrid',"#pager",{edit:false,add:false,del:false});             
        });
08/03/2010
18:48
Avatar
phicarre
Member
Members
Forum Posts: 132
Member Since:
09/11/2009
sp_UserOfflineSmall Offline

With Firebug, Network tab, you can check parameters of your url  http://'+ipserveur+'.....rsons/list

Header, Reply ,HTML

Check reply if empty ... if yes you know where is your problem ...

Rgds,

Phicarre

08/03/2010
18:55
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Thanks Phicarre, but I think that the problem is in repeatitems, in this case (named data) the repeatitems should be set to false.

Best 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.

08/03/2010
19:13
Avatar
aphilippe
Ivory Coast, West Africa
Member
Members
Forum Posts: 6
Member Since:
08/03/2010
sp_UserOfflineSmall Offline

Tony,

   i put repeatitems to false but it's the same way : nothings appear in the grid. Cry

In fact, i'm consume a RESTful service produce by an application (JSF, Spring-CXF,...).

Best Regards.

Philippe

08/03/2010
19:18
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Which version do you use?

Try to use the latest and set in the jsonReader this (your reader is not configuret right I see right now)

jsonReader: { root:"persons.persons", repeatitems:false, id: "0″},

Also not >, but .

Regards

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.

08/03/2010
19:22
Avatar
aphilippe
Ivory Coast, West Africa
Member
Members
Forum Posts: 6
Member Since:
08/03/2010
sp_UserOfflineSmall Offline

Youuuupiiiiiii !!!!

Thanks a lot tony : it work FINE !!

And i love your plugin.

Best Regards.

Philippe

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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