I'm using a x-kendo-template and using a function to make a column editable on click. What its doing is erasing the button, making all columns editable, even though I've specified in the schema for the fields I want to remain false.
<div id="grid"></div>
var dataSource = new kendo.data.DataSource(
transport:{
read: function(options){
// code
},
update: function(options){
// code
},
cancel: function(options){
// code
},
parameterMap: function (options, operation) {
if (operation !== "read" && options.models) {
return { models: kendo.stringify(options.models) };
}
},
schema: {
model: {
id: "grid",
fields: [
Name: { type: "string", editable: false },
Value: { type: "string" }
]
}
}
}
);
<script id="template" type="text/x-kendo-template">
<a class="k-button k-button-icontext k-grid-update k-cust-update k-state-selected"><span class="k-update"></span>Update</a>
<a class="k-button k-button-icontext k-grid-cancel k-cust-cancel k-state-selected"><span class="k-cancel"></span>Cancel</a>
</script>
$('.k-grid-update').on('click', function(){
$("#grid").data("kendoGrid").setOptions({ editable: true });
});
So based on this, Name should not be editable and Value should once the button is clicked.
id:value might be incorrect. The id: value should be the name of a field in the data record that uniquely identifies each row -- in your case it could beName, or perhaps some other field, such asrowIdthat is the identity column in the data base table. - Richard