Unable to get Data on the Grid

2 posts, 0 answers
  1. Linija
    Linija avatar
    1 posts
    Member since:
    Oct 2017

    Posted 27 Oct 2017 Link to this post

    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>

  2. Stefan
    Admin
    Stefan avatar
    2479 posts

    Posted 31 Oct 2017 Link to this post

    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.
Back to Top