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
JSON Data not Loading
12/02/2010
13:03
Avatar
lupin
Member
Members
Forum Posts: 28
Member Since:
12/02/2010
sp_UserOfflineSmall Offline

Greetings,

The json/ouput from my url 'list' is something like this:

{"page":"2","records":"50","rows":[{"id":"1"},[{"total":"cell1","note":"cell2"}]],"total":"10"}

and the following grid definition on my html file, but I can only see the grid without data inside on it's row, what do I miss? I've been re-reading the wiki and docs.Thanks in advance.

jQuery(document).ready(function(){
 jQuery("#list2").jqGrid({
        url:'/list',
        datatype: "json",
        colNames:['Inv No','Total','Notes'],
        colModel:[ {name:'id',index:'id', width:55},
                   {name:'total',index:'total', width:80,align:"right"},
                   {name:'note',index:'note', width:150, sortable:false} ],
        rowNum:10,
        rowList:[10,20,30],
        pager: '#pager2',
        sortname: 'id',
        viewrecords: true,
        sortorder: "desc",
        root: "rows",
        cell: "",
        id:  "0",
        caption:"" });
 jQuery("#list2").jqGrid('navGrid','#pager2',{edit:false,add:false,del:false});
 });
 </script>

regards,

lupin

12/02/2010
13:29
Avatar
HoSpiTaL_gHoSt
Belgium
Member
Members
Forum Posts: 4
Member Since:
03/02/2010
sp_UserOfflineSmall Offline

According to your grid definition, the outcome from your URL should be the following in order to be loaded correctly into your jqGrid:

{"page":"2″,"records":"50″,"rows":[{"id":"1","total":"cell1","note":"cell2"}],"total":"10″}

12/02/2010
13:49
Avatar
lupin
Member
Members
Forum Posts: 28
Member Since:
12/02/2010
sp_UserOfflineSmall Offline

Ok, it's now changed to this:

{"page":"2","records":"50","rows":[{"id":"1","total":"cell1","note":"cell2"}],"total":"10"}

but still no joy, I only see loading button.

12/02/2010
14:51
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

You should configure your jsonReader for this purpose. In order to work this a repeatitems should be set to false

http://www.trirand.com/jqgridw.....#json_data

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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