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

Creating Heirarchy Grid with no Master/Detail

1 Answer 111 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 10 Mar 2013, 11:56 PM
I have an array of JSON objects being returned from a server that looks something like the following:

[{State: Finished, ID: 1234, Owner: John}, {State: Finished, ID: 5678, Owner: Joe}, {State: Active, ID: 8765, Owner: Jane}, {State: Active, ID: 4321, Owner: Jill}]

I would like to put this in a hierarchy Kendo UI grid (NOT groupable but rather as shown at http://demos.kendoui.com/web/grid/hierarchy.html) with the master record being State (Finished, Active) and the detail records being the rest of the JSON object each "state" is associated with. Since there are no master/detail relationships, per se, I don't think the grid detailInit function can work here (unless I create my own pseudo master/detail relationship for this purpose?), but please correct me if I'm wrong. In any event, let me know if what I'm is even possible without jumping through too many hoops to get to the end to get there. Having a small working example here or in JSFiddle would be phenomenal too. :) Thanks.


1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 11 Mar 2013, 07:49 AM
Hello David, 

Here is a one possible way to achieve this, by using only detail template: http://jsbin.com/ogazuf/2/edit

The data item from the parent row will be passed to the detail one. So you can easily bind a template to it.

Other way is manually build the html for the detail cell in detailInit event. Here is a demo for using detailInit event: http://demos.kendoui.com/web/grid/detailtemplate.html

Regards,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
David
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question
or