So Here is the situation:
I am currently initializing a grid with details on the client side. Then I am using a row template on both the regular grid and detail grid to allow check boxes. I have it where a user checks the top grid check box, it will "select" that detail row. The issue that I am having is getting the data of that row, if that makes sense. It doesn't appear this works:
Here is the code:
Grid:
Row Templates:
I am currently initializing a grid with details on the client side. Then I am using a row template on both the regular grid and detail grid to allow check boxes. I have it where a user checks the top grid check box, it will "select" that detail row. The issue that I am having is getting the data of that row, if that makes sense. It doesn't appear this works:
var
grid = $(
"#copyHierarchyGrid"
).data(
'kendoGrid'
);
var
allSelected = grid.select();
Here is the code:
Grid:
var
element = $(
"#copyHierarchyGrid"
).kendoGrid({
dataSource: {
type:
"jsonp"
,
transport: {
read:
'/AdministerRates/GetCombinedRatesToCopy?collection='
+ sCollection
},
pageSize: 6,
serverPaging:
false
,
serverSorting:
false
},
scrollable:
false
,
height:
'auto'
,
sortable:
false
,
pageable:
false
,
detailInit: detailInit,
selectable:
"multiple"
,
dataBound:
function
() {
this
.expandRow(
this
.tbody.find(
"tr.k-master-row"
));
},
columns: [
{
field:
""
,
title:
"Select All"
,
width:
"75px"
},
{
field:
"ProductTypeName"
,
title:
"Product Type"
,
width:
"auto"
}
]
, rowTemplate: kendo.template($(
"#rowTemplate"
).html())
}).data(
'kendoGrid'
);
Row Templates:
<script id=
"rowTemplate"
type=
"text/x-kendo-tmpl"
>
<tr data-uid=
"#: uid #"
class=
"assignment-table-row1 k-master-row"
>
<td class=
"k-hierarchy-cell"
><a class=
"k-icon k-plus"
href=
"\\#"
tabindex=
"-1"
></a></td>
<td class=
"photo"
>
<input type=
"checkbox"
class=
"checkParent"
onchange=
"javascript:testing('#: ProductTypeName#', this)"
/>
</td>
<td>
#:ProductTypeName#</td>
</tr>
</script>
<script id=
"detailRowTemplate"
type=
"text/x-kendo-tmpl"
>
<tr data-uid=
"#: uid #"
id=
"#: uid #"
>
<td>
<input type=
"checkbox"
class=
"checkChild"
onchange=
"javascript:testing('#: SourceProductId#')"
/>
</td>
<td>
#:SourceProductName#</td>
<td>
#:SourceStartDate#</td>
<td>
#:SourceEndDate#</td>
<td>
#:TargetProductName#</td>
<td>
#:TargetStartDate#</td>
<td>
#:TargetEndDate#</td>
</tr>
</script>
function
detailInit(e) {
debugger
$(
"<div/>"
).appendTo(e.detailCell).kendoGrid({
dataSource: e.data.ProductDetails,
scrollable:
true
,
sortable:
false
,
pageable:
false
,
columns: [
{ field:
"SourceProductId"
, title:
"Select Rate"
, },
{ field:
"SourceProductName"
},
{ field:
"SourceStartDate"
},
{ field:
"SourceEndDate"
},
{ field:
"TargetProductName"
},
{ field:
"TargetStartDate"
},
{ field:
"TargetEndDate"
}
],
selectable:
"multiple"
,
rowTemplate: kendo.template($(
"#detailRowTemplate"
).html()),
editable:
true
});
}