【问题标题】:Kendo Grid - How to set different column label in column menuKendo Grid - 如何在列菜单中设置不同的列标签
【发布时间】:2013-11-19 09:56:58
【问题描述】:

看看这个fiddle

var _grid = $("#grid").kendoGrid({
   dataSource: _peopleDataSource,
   filterable: true,
   columnMenu: true,
   columns: [
    {
        field: "id",title: " ",width: 10
    },
    {
        field: "name",title: "Name",width: 40
    },{
        field: "roleTitle",title: "Role",width: 50
    }
   ],
   editable: true
}).data("kendoGrid");

Id 的列没有列标题。但是,在网格列菜单中,我需要将列名显示为Id

我在剑道文档中找不到任何内容。 知道如何实现这一目标吗?

【问题讨论】:

    标签: jquery kendo-ui kendo-grid


    【解决方案1】:

    我建议将title 字段设置为“Id”并使用空的headerTemplate

    var _grid = $("#grid").kendoGrid({
        dataSource: _peopleDataSource,
        filterable: true,
        columnMenu: true,
        columns: [
            {
                field: "id",
                headerTemplate: "",
                title: "Id",
                width: 10
            },
            {
                field: "name",
                title: "Name",width: 40
            },{
                field: "roleTitle",
                title: "Role",width: 50
            }
        ],
        editable: true
    }).data("kendoGrid");
    

    这样,列名不会显示在标题中,而是列在列菜单中。

    查看示例:http://jsfiddle.net/lhoeppner/74LvK/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-03-18
      • 1970-01-01
      • 1970-01-01
      • 2012-11-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多