This is a migrated thread and some comments may be shown as answers.

Kendo Grid ColumnMenu doesn't work with column 'command' property

1 Answer 592 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
faiz
Top achievements
Rank 1
faiz asked on 27 Oct 2020, 03:38 AM

Hi,

When I use a kendo grid column menu with a column.command property, it seems to override the columnMenu,

As a test case, https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/columnmenu

if you put a command in it, you will not see the column menu (3 dotted symbol) in the column header.

Is this how it is intended because I couldn't find any documentation on the situation.

If so, what are your recommendation if I want to use the column menu and also have some custom functions for the column using command property

 

For example:

<div id="grid"></div>
<script>
$("#grid").kendoGrid({
  columns: [
    { field: "name", command: { name: "cmdName", click: function (e) { }}  },
    { field: "age" }
  ],
  columnMenu: true,
  dataSource: [
    { name: "Jane Doe", age: 30 },
    { name: "John Doe", age: 33 }
  ]
});
</script>

1 Answer, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 28 Oct 2020, 12:32 PM

Hello,

By default, the columnMenu is not displayed in the custom command column header. In the provided snippet in your email, there is a custom command configured in a column, that is also bound to a field. I would recommend configuring the columns separately as in the Dojo linked here. 

If you need to have some button/command in a column, you could use the columns.template and configure it depending on the requirements. Here is a small example.

The article linked below demonstrates how to create an external columnMenu:

- https://docs.telerik.com/kendo-ui/knowledge-base/grid-create-an-external-columns-menu

I hope this helps.

Regards,
Neli
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
General Discussions
Asked by
faiz
Top achievements
Rank 1
Answers by
Neli
Telerik team
Share this question
or