This is a migrated thread and some comments may be shown as answers.

Unable to read Remote JSON Data

0 Answers 138 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Balu
Top achievements
Rank 1
Balu asked on 18 May 2012, 03:56 PM
Hi,
I have a WCF service which returns below JSON data & Below is my JQuery function to read JSON data, bind the same to grid.
Problem is: Unable to bind data to grid. Please suggest what changes required to my below function.

Note: my WCF is a RESTful service & multipleSiteBindingsEnabled="true"

[{"Alerts":0,"Cono":"03","CurrentPageIndex":0,"Locations":"E7B","Name":"Abraham, Bethany(426) ","Notifications":0,"Picture":null,"Resno":426,"Search":null,"Sort":null,"Status":0,"pageSize":0,"rcount":4},{"Alerts":0,"Cono":"03","CurrentPageIndex":0,"Locations":"S26A","Name":"Banks, Rebecca M(301) ","Notifications":0,"Picture":null,"Resno":301,"Search":null,"Sort":null,"Status":0,"pageSize":0,"rcount":4},{"Alerts":0,"Cono":"03","CurrentPageIndex":0,"Locations":"","Name":"Carr, William J(405) ","Notifications":0,"Picture":null,"Resno":405,"Search":null,"Sort":null,"Status":0,"pageSize":0,"rcount":4},{"Alerts":0,"Cono":"03","CurrentPageIndex":0,"Locations":"W15A","Name":"Dickerson, Ann A(434) ","Notifications":0,"Picture":null,"Resno":434,"Search":null,"Sort":null,"Status":0,"pageSize":0,"rcount":4},{"Alerts":0,"Cono":"03","CurrentPageIndex":0,"Locations":"E9A","Name":"Dorsey, Linda M(332) ","Notifications":0,"Picture":null,"Resno":332,"Search":null,"Sort":null,"Status":0,"pageSize":0,"rcount":4},{"Alerts":0,"Cono":"03","CurrentPageIndex":0,"Locations":"E5B","Name":"Downey, Darlene J(407) ","Notifications":0,"Picture":null,"Resno":407,"Search":null,"Sort":null,"Status":0,"pageSize":0,"rcount":4},{"Alerts":0,"Cono":"03","CurrentPageIndex":0,"Locations":"E11B","Name":"Easterling, Denise(443) ","Notifications":0,"Picture":null,"Resno":443,"Search":null,"Sort":null,"Status":0,"pageSize":0,"rcount":4},{"Alerts":0,"Cono":"03","CurrentPageIndex":0,"Locations":"E9B","Name":"Eatherly, Harriet(445) ","Notifications":0,"Picture":null,"Resno":445,"Search":null,"Sort":null,"Status":0,"pageSize":0,"rcount":4},{"Alerts":0,"Cono":"03","CurrentPageIndex":0,"Locations":"E10A","Name":"Edgar, Gloria J(430) ","Notifications":0,"Picture":null,"Resno":430,"Search":null,"Sort":null,"Status":0,"pageSize":0,"rcount":4},{"Alerts":0,"Cono":"03","CurrentPageIndex":0,"Locations":"W20A","Name":"Evans, Kelly(461) ","Notifications":0,"Picture":null,"Resno":461,"Search":null,"Sort":null,"Status":0,"pageSize":0,"rcount":4}]


$(document).ready(function () {
    $("#grid").kendoGrid({
        dataSource: {
            type: "odata",
            transport: {
                read: "http://localhost:3472/Service1.svc/json/getresident",
                dataType: "jsonp"
            },
            schema: {
                model: {
                    fields: {
                        Resno: { type: "number" },
                        Alerts: { type: "number" },
                        Notifications: { type: "number" },
                        Locations: { type: "string" },
                        Name: { type: "string" }
                    }
                }
            },
            pageSize: 10,
            serverPaging: true,
            serverFiltering: true,
            serverSorting: true
        },
        height: 250,
        filterable: true,
        sortable: true,
        pageable: true,
        columns: [{
            field: "Resno",
            title: "Res No",
            width: "100px"
        }, {
            field: "Name",
            title: "Res Name",
            width: "200px"
        }, {
            field: "Locations",
            title: "Location"
        }, {
            field: "Notifications",
            title: "Notifications",
            width: "200px"
        }, {
            field: "Alerts",
            title: "Alerts"
        }]
    });
});

No answers yet. Maybe you can help?

Tags
Data Source
Asked by
Balu
Top achievements
Rank 1
Share this question
or