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

Unable to get Data on the Grid

1 Answer 147 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Linija
Top achievements
Rank 1
Linija asked on 27 Oct 2017, 09:26 AM

I am using this code to bind data to Grid but my grid is empty. I can see the json data from the url

<body>
    <div id="grid">
        <script >
            $(document).ready(function () {
                $("#grid").kendoGrid({
                  
                    dataSource: {
                        transport: {
                            read: {
                                url: "http://localhost:64878/api/GetData",
                                dataType: "jsonp",
                                type: "GET"
                            }
                        },
                        schema: {
                            model: {
                                fields: {
                                    AIDAParentName: { type: "string" },
                                    AIDAChildNames: { type: "string" },
                                    PortfolioName: { type: "string" },
                                    Class: { type: "string" }
                                }
                            }
                        }
                    },
                    height: 500,
                    scrollable: true,
                    selectable: true,
                    columns: [{
                        field: "AIDAParentName",
                        filterable: false
                    },
                          
                           {
                               field: "AIDAChildNames"
                              
                           }, {
                               field: "PortfolioName"
                           }, {
                               field: "Class"
                           }
                    ]
                });
            });
        </script>
    </div>

</body>

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 31 Oct 2017, 08:46 AM
Hello, Linija,

Thank you for providing the Grid configuration.

After inspecting it, it looks good. 

I added a dummy data and the Grid was initialized with it as expected:

http://dojo.telerik.com/oXaSi

Please inspect the response format in the network tab to observe if it is in the correct format. It may need to be parsed:

https://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-schema.data

If the issue still occurs, please provide the response received from the server and I will gladly assist.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Linija
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or