HierarchicalDataSource with a Grid doesn't show Details.

2 posts, 1 answers
  1. Alexandre
    Alexandre avatar
    12 posts
    Member since:
    May 2009

    Posted 24 Jan 2013 Link to this post

    Hi is the HierarchicalDataSource suppose to work with a Grid?
    On the Kendo UI docs http://docs.kendoui.com/getting-started/framework/hierarchicaldatasource/overview looks like it is suppose to work but, when I tried only the 1st level show on the grid, all the details doesn't appear.
    var gridDataSource = new kendo.data.HierarchicalDataSource({
        transport: {
            read: {
                url: "/services/BookingTotals.ashx",
                dataType: "json"
            }
        },
        schema: {
            model: {
                id: "Id",
                hasChildren: true,
                children: {
                    transport: {
                        read: {
                            url: "/services/LocationBookingTotals.ashx",
                            dataType: "json"
                        }
                    },
                    schema: {
                        model: {
                            hasChildren: true,
                            id: "LocationId",
                            children: {
                                transport: {
                                    read: {
                                        url: "/services/ServClassBookingTotals.ashx",
                                        dataType: "json"
                                    }
                                },
                                schema: {
                                    model: {
                                        hasChildren: false,
                                        id: "ServiceClassGlobalId",
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    });
    $("#grid").kendoGrid({
        groupable: false,
        scrollable: true,
        sortable: true,
        pageable: true,
        dataSource: gridDataSource
    });
    Am I doing something wrong or the kendo ui grid isn't suppose to work this way?
  2. Answer
    Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 28 Jan 2013 Link to this post

    Hello Alexandre,

    The hierarchical dataSource is intended to be used in combination with the TreeView widget and combining it with the Grid is not supported.

    To create hierarchy of Grids I suggest you to follow the approach in this online demo.

    For reference I added a project which uses single JSON to create the hierarchy. Keep in mind that editing for such single object hierarchy is not supported.

    I hope this helps.

    Kind regards,
    Petur Subev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
Back to Top