Inside a main grid I have a nested detail grid and a button. How is it possible to add a row to the nested grid on a button click. My solution doesn't work: @scope.detailsGrid is undefined (which is predictable).
$scope.addRow = function () {
var grid = $scope.detailsGrid.data("kendoGrid");
grid.addRow();
return false;
};
<
kendo-grid
k-scope-field
=
"mainGrid"
options
=
"mainGridOptions"
>
<
div
k-detail-template>
<
div
kendo-grid
k-scope-field
=
"detailsGrid"
k-options
=
"detailGridOptions(dataItem)"
></
div
>
<
button
ng-click
=
"addRow()"
style
=
"width:100px; height:30px;"
>Add row</
button
>
</
div
>
</
kendo-grid
>