使用headerAttributes属性设置列标题样式
data: function () {
return {
//自定义列集合,页面只显示需要列
columns: [
// field:列名,title:列标题,format:数据掩码格式;locked:锁定列(Grid必须有水平滚动条才使用锁定功能)
{
field: "selected",
selectable: true,
width: 40,
headerAttributes: {
style: "text-align: center;",//列标题使用的行内样式
'class':'GridHeader',//列标题使用的自定义类选择器
},
}, //设置选择列
{
field: "",
title: "行号",
template: "<span class='ROWID'></span>",
width: 55,
headerAttributes: {
style: "text-align: center;",//列标题使用的行内样式
'class':'GridHeader',//列标题使用的自定义类选择器
},
},
{
field: "USER_ID",
title: "用户ID",
headerAttributes: {
style: "text-align: center;",//列标题使用的行内样式
'class':'GridHeader',//列标题使用的自定义类选择器
},
},
{
field: "USER_CODE",
title: "用户账号",
headerAttributes: {
style: "text-align: center;",//列标题使用的行内样式
'class':'GridHeader',//列标题使用的自定义类选择器
},
},
{
field: "USER_PWD",
title: "用户密码",
headerAttributes: {
style: "text-align: center;",//列标题使用的行内样式
'class':'GridHeader',//列标题使用的自定义类选择器
},
},
{
field: "USER_NAME",
title: "用户姓名",
headerAttributes: {
style: "text-align: center;",//列标题使用的行内样式
'class':'GridHeader',//列标题使用的自定义类选择器
},
},
{
field: "REC_CREATOR",
title: "记录创建人",
headerAttributes: {
style: "text-align: center;",//列标题使用的行内样式
'class':'GridHeader',//列标题使用的自定义类选择器
},
},
{
field: "REC_CREATE_TIME",
title: "记录创建时间",
format: "{0:yyyy-MM-dd HH:mm:ss}",
'class':'GridHeader',
width: 200,
headerAttributes: {
style: "text-align: center;",//列标题使用的行内样式
'class':'GridHeader',//列标题使用的自定义类选择器
},
},
{
field: "REC_MODIFIER",
title: "记录修改人",
headerAttributes: {
style: "text-align: center;",//列标题使用的行内样式
'class':'GridHeader',//列标题使用的自定义类选择器
},
},
{
field: "REC_MODIFY_TIME",
title: "记录修改时间",
format: "{0:yyyy-MM-dd HH:mm:ss}",
width: 200,
headerAttributes: {
style: "text-align: center;",//列标题使用的行内样式
'class':'GridHeader',//列标题使用的自定义类选择器
},
},
],
//toolbar:[{template: kendo.template($("#gridBar").html())}]
};
},