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

Grid detailTemplate definition fo dynamic list.

1 Answer 40 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marcin
Top achievements
Rank 1
Veteran
Marcin asked on 18 Dec 2013, 03:24 PM
Hello,
could you advice me how to achieve following thing:
1. Let's assume I have list of objects with: Property1,Property2,Property3,Other
2. I can bind normaly Property1,Property2,Property3 to grid and it will be properly displayed.
3. Other property is in fact list of pairs

I would like to display all elements of that list in grid details. Could you tell me how to define such template? I know how to assign one value, e.g:
<label>#= Address #</label>
But how to bind many elements?

Best Regard
Marcin

1 Answer, 1 is accepted

Sort by
0
Accepted
Petur Subev
Telerik team
answered on 19 Dec 2013, 01:33 PM
Hello Marcin,

Basically you can go the same way as shown in the following demo:

http://demos.kendoui.com/web/grid/detailtemplate.html

The only difference is that you will have to use direct/initial binding (not remote transport) for the inner Grid.

something like this:

function detailInit(e) {
 
                   detailRow.find(".orders").kendoGrid({
                       dataSource: {
                           type: "odata",
                           data: e.data.NestedCollectionField,
                           serverPaging: true,
                           serverSorting: true,
                           serverFiltering: true,
                           pageSize: 5,
                           filter: { field: "EmployeeID", operator: "eq", value: e.data.EmployeeID }
                       },
                       scrollable: false,
                       sortable: true,
                       pageable: true,
                       columns: [
                           { field: "OrderID", title:"ID", width: "56px" },
                           { field: "ShipCountry", title:"Ship Country", width: "110px" },
                           { field: "ShipAddress", title:"Ship Address" },
                           { field: "ShipName", title: "Ship Name", width: "190px" }
                       ]
                   });
               }


Kind Regards,
Petur Subev
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
Marcin
Top achievements
Rank 1
Veteran
Answers by
Petur Subev
Telerik team
Share this question
or