I want to change editable property of the field, but this way it doesn't work. How can I fix this?
function changeDescription(rawGrid, isEditableDescription) {
var grid = rawGrid.data("kendoGrid");
if (!grid) return;
if (isEditableDescription) {
grid.dataSource.options.schema.model.fields["Description"].editable = true;
}
else {
grid.dataSource.options.schema.model.fields["Description"].editable = false;
}
}
You need to call the setOptions method of the grid: https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/methods/setoptions
var grid = $('#grid').data('kendoGrid');
var options = grid.getOptions();
var editable = !options.columns[0].editable || options.columns[0].editable();
options.columns[0].editable = function() { return !editable; };
grid.setOptions(options);