Reputation: 21
I have a Kendo grid which I have generated in jQuery :
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
},
});
Now as you can see in the code the column menu come for every column of the grid. What I want that it should not come for a particular column that is StatusID
in my case.
Can any one help me in solving this?
Upvotes: 0
Views: 636
Reputation:
Below code can help you in achieving this:
In Place of StatusID you can put the name of any of the column on which you want to remove the column Menu.
var grid = $('#YourGridID').data("kendoGrid");
grid.thead.find("[data-field=StatusID]>.k-header-column-menu").remove();
Upvotes: 1