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
Nested Json, not getting populated in the Grid.
28/01/2010
13:46
Avatar
brokentools
Member
Members
Forum Posts: 4
Member Since:
28/01/2010
sp_UserOfflineSmall Offline

Hi all,

I've linked up my question with this post - http://www.trirand.com/blog/?p.....undefined/ . But getting a little impatient and worried that people might not look at older posts.  Can you please tell me what's wrong with this json and this jsonreader? For some reason i'm not able to populate the grid with actual data although i have the correct number of rows.

my json looks like this and is a valid json

{
    "records": 4,
    "total": 5,
    "rows": [
        {
            "cell": {
                "lastname": "V",
                "_type": "User",
                "uid": "u11",
                "firstname": "Megha"
            }
        },
        {
            "cell": {
                "lastname": "V",
                "_type": "User",
                "uid": "u12",
                "firstname": "Prashant"
            }
        },
        {
            "cell": {
                "lastname": "A",
                "_type": "User",
                "uid": "u1",
                "firstname": "Shalini"
            }
        },
        {
            "cell": {
                "lastname": "V",
                "_type": "User",
                "uid": "u0",
                "firstname": "Megha"
            }
        }
    ]
}

This is my grid description -

$(document).ready(function(){
// This is a basic jqGrid with a navGrid (that adds a search button)
    jQuery('#list').jqGrid({
        url:'/user/get_users/',
        datatype: "json",
        
    colNames: ['First Name','Last Name','UID'],
        colModel: [{
                name: 'firstname',
                index: 'firstname'
            }, {
                name: 'lastname',
                index: 'lastname'
            }, {
                name: 'uid',
                index: 'uid asc, invdate'
            }],
    jsonReader : {
             root: "rows",
             page: "page",
             total: "total",
             records: "records",  
             repeatitems: false,
             cell: "cell",
             id: "id",
             userdata: "userdata",    
       },
        rowNum:10,
        rowList:[10,20,30],
        multiselect: false,
        width: 700,
        height: 100,
        pager: jQuery('#pager'),
        sortname: 'uid',
        viewrecords: true,
        sortorder: "asc",
        caption: "Users"
    }).navGrid("#pager",{edit:false,add:false,del:false},{},{width:200},{});
});

28/01/2010
13:55
Avatar
brokentools
Member
Members
Forum Posts: 4
Member Since:
28/01/2010
sp_UserOfflineSmall Offline

oops! Got it here - http://www.trirand.com/blog/?p.....-notation/

Ignore me!Embarassed

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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