I have a Parent/Child grid. For the rows selected I need to get the Parent and child rows data.
I don't see any examples. Can someone point me to one?
Thanks
Greg
1 Answer, 1 is accepted
0
Dimiter Madjarov
Telerik team
answered on 30 Apr 2015, 07:46 AM
Hello Greg,
You could find the selected rows in the master Grid via their CSS classes - k-master-row and k-state-selected.
E.g.
var grid = $("#grid").data("kendoGrid");
var selected = grid.tbody.find("tr.k-master-row.k-state-selected");
Then you could check if the next row for each of them has the k-detail-row CSS class. This will mean that the corresponding detail row has been expanded at least once.
E.g.
selected.each(function(e){
var nextRow = $(this).next("tr");
if(nextRow.hasClass("k-detail-row")){
var childGrid = nextRow.find(".k-grid").data("kendoGrid");