editable.confirmation Boolean|String|Function
(default: true)
If set to true
the grid will display a confirmation dialog when the user clicks the "destroy" command button.
Can be set to a string which will be used as the confirmation text.
Can be set to a function which will be called, passing the model instance, to return the confirmation text.
This and all Grid configuration properties can be set (enabled/disabled) after the grid has been initialized with the setOptions method.
Example - disable delete confirmation
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [
{ field: "name" },
{ field: "age" },
{ command: "destroy" }
],
dataSource: {
data: [
{ id: 1, name: "Jane Doe", age: 30 },
{ id: 2, name: "John Doe", age: 33 }
],
schema:{
model: {
id: "id",
fields: {
age: { type: "number"}
}
}
}
},
editable: {
confirmation: false
}
});
</script>
Example - set delete confirmation text
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [
{ field: "name" },
{ field: "age" },
{ command: "destroy" }
],
dataSource: {
data: [
{ id: 1, name: "Jane Doe", age: 30 },
{ id: 2, name: "John Doe", age: 33 }
],
schema:{
model: {
id: "id",
fields: {
age: { type: "number"}
}
}
}
},
editable: {
confirmation: "Are you sure that you want to delete this record?"
}
});
</script>
Example - set delete confirmation as function
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [
{ field: "name" },
{ field: "age" },
{ command: "destroy" }
],
dataSource: {
data: [
{ id: 1, name: "Jane Doe", age: 30 },
{ id: 2, name: "John Doe", age: 33 }
],
schema:{
model: {
id: "id",
fields: {
age: { type: "number"}
}
}
}
},
editable: {
confirmation: function(e) {
return "Are you sure that you want to delete record for " + e.name + "?";
}
}
});
</script>