从列中删除列菜单

时间:2014-02-26 06:32:09

标签: jquery kendo-ui kendo-grid

我有一个我在jQuery中生成的Kendo网格:

jQuery的:

  divSearchGrid.kendoGrid({
            dataSource: {
                transport: {
                    read: function (options) {
                        $.ajax({
                            type: "POST",
                            url: urlSearch,
                            data: paramsSearch,
                            contentType: "application/json; charset=utf-8",
                            dataType: "json",
                            success: function (result) {
                            options.success(structuredData)
                           }
                        })
                     }
                    ,
                schema: {
                    model: {
                        id: "GUID",
                        fields: {
                            StatusID: { editable: false, groupable: false, sortable: false },
                            AttID: { editable: false, groupable: false, sortable: false },
                            TaskID: { editable: false, nullable: true, groupable: true, type: 'number' },
                            ServiceName: { editable: false, nullable: true, groupable: true },
                            TaskDescription: { nullable: true, groupable: true },
                            FolderDescription: { editable: false, nullable: true, groupable: true },
                            FolderSubject: { editable: true, nullable: true, groupable: true },
                            ServiceRequestID: { editable: false, nullable: true, groupable: true, type: 'number' },
                            PSRID: { editable: false, nullable: true, groupable: true },
                            PSRSubject: { editable: false, nullable: true, groupable: true }
                        }
                    }
                },
                pageSize: 10
            },
            batch: true,
            groupable: true,
            scrollable: true,
            sortable: true,
            reorderable: true,
            resizable: true,
            selectable: "row"
            autoSync: true,
            editable: true,
            navigatable: true,
            columns: columnList,
            columnMenu: true,
            filterable: true,
            columnMenu: {
                sortable: false
            },
            pageable: {
                refresh: true,
                pageSizes: true,
                buttonCount: 5
            },
        });

现在您可以在代码中看到列菜单来自网格的每一列。我希望它不应该出现在我的情况下StatusID的特定列。

任何人都可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

下面的代码可以帮助您实现这一目标:

在StatusID的位置,您可以输入要删除列菜单的任何列的名称。

var grid = $('#YourGridID').data("kendoGrid");
grid.thead.find("[data-field=StatusID]>.k-header-column-menu").remove();