Use gird editable 'popup', when click edit button and pop up a dialog and click 'cancel', the edit row will be deleted. Here is the demo code~
<div id="grid" data-role="grid" data-scrollable="true"
data-editable="popup" data-toolbar="['create' ]"
data-columns="[
{ 'field': 'DashboardName', 'width': 200 },
{ 'field': 'DashboardDescription', 'width': 300 },
{ 'command': ['edit', 'destroy' ], 'title': ' ', 'width': 150 }
]"
data-bind="source: dashboardSource" style="width: 800px; height:500px;">
</div>
<script type="text/javascript">
$(document).ready(function () {
kendo.bind(document.body, viewModel);
});
var viewModel = kendo.observable({
dashboardSource: new kendo.data.DataSource({
schema: {
model: {
id: "DashboardId",
fields: {
DashboardId: { editable: false },
DashboardName: { validation: { required: true } },
DashboardDescription: { },
UserAlias: { validation: { required: true } }
}
}
},
data: []
}),
});
</script>
<div id="grid" data-role="grid" data-scrollable="true"
data-editable="popup" data-toolbar="['create' ]"
data-columns="[
{ 'field': 'DashboardName', 'width': 200 },
{ 'field': 'DashboardDescription', 'width': 300 },
{ 'command': ['edit', 'destroy' ], 'title': ' ', 'width': 150 }
]"
data-bind="source: dashboardSource" style="width: 800px; height:500px;">
</div>
<script type="text/javascript">
$(document).ready(function () {
kendo.bind(document.body, viewModel);
});
var viewModel = kendo.observable({
dashboardSource: new kendo.data.DataSource({
schema: {
model: {
id: "DashboardId",
fields: {
DashboardId: { editable: false },
DashboardName: { validation: { required: true } },
DashboardDescription: { },
UserAlias: { validation: { required: true } }
}
}
},
data: []
}),
});
</script>