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

[Solved] Grid in a Grid

1 Answer 81 Views
Grid
This is a migrated thread and some comments may be shown as answers.
crazy05
Top achievements
Rank 1
crazy05 asked on 03 Mar 2015, 05:30 PM
Hello,

I am displaying Grid and using detailTemplate to expandRow. But when expand the row, I want to pass the row ID and get datasource and display another grid.

I think detailTemplate won't work in this case. How can I do this ?

Here is my Code

 $(document).ready(function () {
                   var dataSource = new kendo.data.DataSource({
                       pageSize: 20,
                       data: [
                         { id: "1", name: "Andrew", age: "30" },
                         { id: "2", name: "Robert", age: "29" },
                         { id: "3", name: "Frank", age: "35" }
                       ],
                       autoSync: true,
                       schema: {
                           model: {
                             id: "id",
                             fields: {
                                id: { editable: false, nullable: true, type: "number" },
                                name: { editable: false },
                                age: { 
                                    validation: { min: 0, required: true },
                                    editable: true, 
                                    nullable: true,
                                    type: "number"
                                }
                             }
                           }
                       }
                    });

                    $("#grid").kendoGrid({
                        dataSource: dataSource,
                        pageable: true,
                        height: 550,
                        editable: "inline",
                        columns: [
                            { field: "name",title: "Name" },
                            { field: "age", title: "Age", width: "180px"},
                            { command: ["edit"] }
                        ],
                                detailTemplate: "<div>Name: #: name #</div><div>Age: #: age #</div>"
                    });
                });

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 05 Mar 2015, 09:23 AM

Hello Ram,

You can use detailInit event as demonstrated in the following example - http://demos.telerik.com/kendo-ui/grid/detailtemplate

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