columns.editable Function
The JavaScript function executed when the cell/row is about to be opened for edit. The result returned will determine whether an editor for the column will be created.
Example - conditionally edit a cell
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [
{ field: "name",
editable: function (dataItem) {
return dataItem.name === "Jane"; // Name editor is created only if dataItem name is Jane
}
},
{
field: "salary",
editable: function (dataItem) {
return dataItem.name === "Jane"; // Salary editor is created only if dataItem name is Jane
}
}
],
editable: true,
dataSource: [ { name: "Jane", salary: 2000 }, { name: "Bill", salary: 2000 } ]
});
</script>