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

[Solved] Get Modified dataSource from detailTemplate KendoGrid

1 Answer 319 Views
Grid
This is a migrated thread and some comments may be shown as answers.
crazy05
Top achievements
Rank 1
crazy05 asked on 10 Mar 2015, 03:22 PM
I have a detailTemplate in KendoGrid. That detailTemplate again contains Grid. I want to get the modified dataSource of the detailTemplate Kendo Grid. How can I get that ? Here is my Code.

$("#grid").kendoGrid({
dataSource: dataSource,
detailTemplate: kendo.template($("#template").html()),
detailInit: detailInit,
dataBound: function () {
},
columns: [
{ field: "Id", hidden: true },
{ field: "Name", title: "Name" }
]
});

<script type="text/x-kendo-template" id="template">
<div class="SiteGrid" id="#: Id #">
</div>
</script>

function detailInit(e) {
var detailRow = e.detailRow;

detailRow.find(".SiteGrid").kendoGrid({
dataSource: dataSource,
columns: [
{ field: "Id", hidden: true },
{ field: "Name", title: "Name", width: 350 }
]
});
}

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 12 Mar 2015, 09:53 AM

Hello Ram,

 

You must find the detail Grid which interests you and then get the reference to the DataSource.

 

For example the following code executed in the console will get the first detail grid data source in the Hierarchy Grid demo:

 

$("#grid").data("kendoGrid").table.find(".k-detail-row").first().find(".k-grid").data("kendoGrid").dataSource

 

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