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

How to using setDataSource method on Hierarchy Grid ??

1 Answer 109 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 06 Aug 2013, 02:27 PM
How to use setDataSource on Hierarchy Grid

Hello All -

I have a Hierarchy Grid created.. and I need to refresh the data sources after certain events... How do i go about doing it..
I know we can use setDataSource method on the Grid's widget.. but i really dont know how to get the widget for a hierarchy grid..

usually if i have a div element.. i would say
var grid = $("#grid").data("kendoGrid");
grid.setDataSource(dataSource);

but in a hierarchy grid... the child grid is created as
$("<div/>").appendTo(detailCell).kendoGrid({
            dataSource: {
                data: ReturnData
            }, ......

How do i obtain the widget for this and rebind the data source..?

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 08 Aug 2013, 07:07 AM
Hi,

 You need a way to select your child grids with jQuery. Adding a class to that div would allow it:

$("<div class='detailGrid' />").appendTo(detailCell)

 And then 

var detailGrid =  $(".detailGrid").data("kendoGrid");

Regards,
Atanas Korchev
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
Chris
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or