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

HierarchicalDataSource with a Grid doesn't show Details.

1 Answer 255 Views
Hierarchical Data Source
This is a migrated thread and some comments may be shown as answers.
Alexandre
Top achievements
Rank 1
Alexandre asked on 24 Jan 2013, 06:23 PM
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?

1 Answer, 1 is accepted

Sort by
0
Accepted
Petur Subev
Telerik team
answered on 28 Jan 2013, 02:14 PM
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!
Tags
Hierarchical Data Source
Asked by
Alexandre
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or