我正在使用x-kendo模板,并使用一个函数来使单击时的列可编辑。这样做是在擦除按钮,使所有列都可编辑,即使我已在架构中为要保留为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 });
});
因此,基于此,单击按钮后,名称将不可编辑,值将不可编辑。
答案 0 :(得分:0)
问题尚不清楚,我不明白你在哪里,但这也许可以帮到你
此示例使用x-kendo-tmpl,您可以使用禁用对一个col的编辑
dataSource->模式->模型->字段->->可编辑:false