我正在绕过KendoGrid。我下载的这个示例有一个“标题”列和“城市”列。标题栏是可编辑的,但我想添加一个业务规则,当标题与'City'value相同时,它应该变得不可编辑。此外,我想将标题背景的样式更改为灰色或某些东西,使它看起来像你不能再编辑它。网格看起来像这样:
var grid = $("#grid").kendoGrid({
dataSource: {
data : createRandomData(50),
pageSize: 10,
schema : {
model: {
fields: {
id : { type: 'number' },
FirstName: { type: 'string' },
LastName : { type: 'string' },
City : { type: 'string' },
Title : { type: 'string' },
BirthDate: { type: 'date' },
Age : { type: 'number' }
}
}
}
},
editable : "incell",
pageable : {
refresh : true,
pageSizes: true
},
columns : [
{
field: "FirstName",
width: 90,
title: "First Name"
} ,
{
field: "LastName",
width: 90,
title: "Last Name"
} ,
{
width: 100,
field: "City"
} ,
{
field: "Title"
} ,
{
field : "BirthDate",
title : "Birth Date",
template: '#= kendo.toString(BirthDate,"dd MMMM yyyy") #'
} ,
{
width: 50,
field: "Age"
}
]
}).data("kendoGrid");