MVC ラッパーを使用する代わりに、これを JavaScript で記述するにはどうすればよいですか?
@(Html.Kendo().Grid(Model.List)
.Name("grid")
.Columns(c => {
c.Bound(e => e.ID);
c.Bound(e => e.Nom).HeaderHtmlAttributes(new { colspan = 2 });
c.Bound(e => e.Nb).HeaderHtmlAttributes(new { style= "display:none;" });
})
)
実験のために次のコードから始めました。上記の属性と完全に一致しないことはわかっていますが、Kendo グリッドの javascript を使用して列の HeaderHtmlAttributes と Headertemplate を設定するにはどうすればよいですか?
$("div#kendogrid").kendoGrid({
dataSource: dataSource,
columns: [
{
field: "ID",
title: "Nr Id",
headerTemplate: "sample template text col 1",
width: 100
},
{
field: "Nom",
headerAttributes: {
"class": "myHeader",
style: "text-align: right"
},
width: 200
}
]
});