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
data no load
21/10/2011
07:24
Avatar
eddiehuihk
New Member
Members
Forum Posts: 1
Member Since:
21/10/2011
sp_UserOfflineSmall Offline

Hi,

I  am now trying to using jdGrid and load the data returned by WCF.

I can successfully retreive the data in json format but i fall to load the data into the grid.

Here's what I write:

var service_endpoint = "http://127.0.0.1:49303/Service1.svc/";
    $("#list2″).jqGrid({
        url : service_endpoint + "GetUsers",
        datatype : "json",
        jsonReader : {
            root : "rows",
            page : "page",
            total : "total",
            records : "records",
            repeatitems : false,
            id : "Username"
        },
        colNames : ['Username', 'Userteam','Usertitle','Useraccount'],
        colModel : [{
            name : 'Username',
            index : 'Username',
            width : 60,
            align : "right"
        }, {
            name : 'Userteam',
            index : 'Userteam',
            width : 120,
            sortable : false
        }, {
            name : 'Usertitle',
            index : 'Usertitle',
            width : 120,
            sortable : false
        }, {
            name : 'Useraccount',
            index : 'Useraccount',
            width : 120,
            sortable : false
        }],
        pager : '#pager2',
        rowNum : 10,
        rowList : [10, 20, 30],
        sortname : 'Username',
        viewrecords : true,
        sortorder : "asc",
        caption : "Users"
    }).navGrid('#pager2', { edit: false, add: false, del: false, view: false, refresh: false });

wcf response:

HTTP/1.1 200 OK
Server: ASP.NET Development Server/10.0.0.0
Date: Fri, 21 Oct 2011 04:21:23 GMT
X-AspNet-Version: 2.0.50727
Cache-Control: private
Content-Type: application/json; charset=utf-8
Content-Length: 1039
Connection: Close

{"page":1,"records":159,"rows":[{"Useraccount":"","Username":"","Userteam":"","Usertitle":""},{"Useraccount":"awa840","Username":"awa840","Userteam":"TESTA","Usertitle":"TEST"}],"total":16}

The data returns seems in correct format but the data is not loaded into the grid. Have I missed anything?

Thanks very much.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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