I am facing an issue with a kendo grid that is embedded inside a kendo window template. This grid gets its data from another grid on the main UI, following a model hierarchy of Fund -> Currency -> Allocations. The main UI grid displays the entire dataset, with the Fund containing a detail-template that shows its currencies and their allocations.
Let me share some of the code snippets:
Main Grid:
<div kendo-grid="ctrl.fundGrid" style="margin-top: 2em" k-options="ctrl.fundGridOptions" k-scope-field="kgrid" id="myGrid" k-height='600'></div>
Edit Window Template:
<script id="edit-template" type="text/x-kendo-template">
<div class="container">
<div kendo-grid="ctrl.currencyKendoGrid" ng-show="ctrl.IsVisible" style="margin-top: 2em" id="myGrid" k-options="ctrl.currencyGridOptions">
<div k-detail-template>
<div id="allocGrid" kendo-grid k-options="ctrl.allocationGridOptions(dataItem)" ng-show="dataItem.FundCurrencyId!=0"></div>
</div>
</div>
</div>
The editable configuration settings for the edit window template:
editable: {
mode: "popup",
template: kendo.template($("#edit-template").html()),
//confirmation: "Are you sure you want to delete this fund?",
window: {
title: "Edit Fund Details",
animation: false,
height: "800",
width: "1200"
}
},
Event handler for editing in the main grid:
edit: function (e) {
if (e.model.Currencies)
ctrl.currencyKendoGrid.dataSource.data(e.model.Currencies);
}
The dataSource read configuration for the Currency grid:
dataSource: {
transport: {
read: function (e) {
e.success();
},
}
}
The Currency grid is editable with edit and destroy commands set up. However, I'm encountering an issue where cancelling an inline edit on a currency row does not restore the original data. Can anyone help me understand how to make the kendo grid restore its state on cancel, and identify any issues in my implementation?