Telerik Forums
Kendo UI for Angular Forum
1 answer
7 views
Hi Telerik Team,

I'm currently using the <kendo-contextmenu> (@progress/kendo-angular-menu v15.3.0.) component in an Angular application, and I'm binding menu items dynamically using the [items] input.

I would like to conditionally disable a specific menu item based on a boolean variable. However, I’ve found that the disabled property on a MenuItem is not respected when using data-binding mode.


What I've tried so far:
Adding disabled: true and cssClass in the item definition

Using kendoContextMenuItemTemplate with custom ngClass to style the item

Preventing the (select) event manually

Styling with pointer-events: none

Injecting disabled attribute at runtime using requestAnimationFrame as a workaround

Problem:
None of the above approaches allow me to truly disable the menu item (i.e., prevent interaction at the <li> level) via a clean Angular-style directive or binding.

Question:

Is there an officially supported way (or recommended workaround) to disable items in a Kendo Angular ContextMenu when using the [items] binding?

If not currently supported, is this on the roadmap?

Any guidance or alternatives would be greatly appreciated.

Thank you!
Martin Bechev
Telerik team
 answered on 11 Jul 2025
0 answers
67 views

Hi,

Can you please let me know the issue with my code using the css or theme? I have copied the code of building block of "Hero2" and I followed the below link to apply the theme

https://www.telerik.com/design-system/docs/themes/get-started/installation/#using-external-cdn-link

 

I have used the below code part in index.html.. the fonts and colors are not displaying the correct one and also there is no logo or image.

Please let me know the steps to proceed to use the building blocks in our portal

 

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>TestKendoMenu1</title>
  <base href="/">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">
  <link rel="stylesheet" href="https://unpkg.com/@progress/kendo-theme-default@9.0.0/dist/all.css" />
  <link rel="stylesheet" href="https://unpkg.com/@progress/kendo-theme-utils@9.0.0/dist/all.css" />
</head>
<body>
  <app-root></app-root>
</body>

</html>

 

 

 

 

 

Jeyganesh
Top achievements
Rank 1
 asked on 21 Nov 2024
0 answers
47 views
I have the below componet and i am trying to change the highlight color for the popup menu list:


import { Component, input, Input } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MenusModule } from '@progress/kendo-angular-menu';
import { ICON_SETTINGS, SVGIcon } from '@progress/kendo-angular-icons';

@Component({
  selector: 'mnp-menu-item',
  standalone: true,
  imports: [CommonModule, MenusModule],
  providers: [{ provide: ICON_SETTINGS, useValue: { type: 'font', size: 'medium' } }],
  template: `
     <link
      rel="stylesheet"
      href="https://unpkg.com/@progress/kendo-font-icons/dist/index.css"
    />

    <kendo-menu [items]="items"
    >
      <ng-template kendoMenuItemTemplate let-item="item" >
        <span  class='item'>
        <span class="icon-container">
          <ng-container *ngIf="item.icon; else noIcon">
            <span [ngClass]="item.icon" class="k-icon"></span>
          </ng-container>
          <ng-template #noIcon>
            <span class="k-icon empty-icon"></span>
          </ng-template>
        </span>
        {{ item.text }}
        </span>
      </ng-template>
    </kendo-menu>
  `,
    styleUrl: './menu-item.component.scss',
    

})
export class MenuItemComponent {
  @Input() items: MenuItem[] = [];
  @Input() vertical: boolean = false;

}

interface MenuItem {
  text?: string;
  url?: string;
  icon?: string;  // Dynamic icon field
  disabled?: boolean;
  separator?: boolean;
  svgIcon?: SVGIcon;
  cssClass?: string;
  items?: MenuItem[];
}

Layth
Top achievements
Rank 1
Iron
 asked on 18 Oct 2024
0 answers
113 views
please can I get a help, I am trying to change the highlight color for the menu item for the below component 



import { Component, input, Input } from '@angular/core';
import { CommonModule } from '@angular/common'; import { MenusModule } from '@progress/kendo-angular-menu'; import { ICON_SETTINGS, SVGIcon } from '@progress/kendo-angular-icons'; @Component({ selector: 'mnp-menu-item', standalone: true, imports: [CommonModule, MenusModule], providers: [{ provide: ICON_SETTINGS, useValue: { type: 'font', size: 'medium' } }], template: ` <link rel="stylesheet" href="https://unpkg.com/@progress/kendo-font-icons/dist/index.css" /> <kendo-menu [items]="items" > <ng-template kendoMenuItemTemplate let-item="item" > <span class='item'> <span class="icon-container"> <ng-container *ngIf="item.icon; else noIcon"> <span [ngClass]="item.icon" class="k-icon"></span> </ng-container> <ng-template #noIcon> <span class="k-icon empty-icon"></span> </ng-template> </span> {{ item.text }} </span> </ng-template> </kendo-menu> `, styleUrl: './menu-item.component.scss', }) export class MenuItemComponent { @Input() items: MenuItem[] = []; @Input() vertical: boolean = false; } interface MenuItem { text?: string; url?: string; icon?: string; // Dynamic icon field disabled?: boolean; separator?: boolean; svgIcon?: SVGIcon; cssClass?: string; items?: MenuItem[]; }

I have tried to use the cssClass approach but it is not working

Layth
Top achievements
Rank 1
Iron
 updated question on 18 Oct 2024
0 answers
48 views

Hi,

I am trying to build angular 17 standalone component based on kendo ui menu for angular. Goal is to replace menu in old angularjs app built using kendo ui for jquery. I am trying to migrate little parts one by one.

I built component and added it to the old app, menu is rendered using default theme, but for some reason menu is dead - open or select events don't trigger. So i don't see submenus or cant select even anything on the root.

On the other side, if i put kendo ui button for angular in the same component, it works normally and triggers event on click.

Do you please have any ideas how to proceed next, because menu is one of crucial components I need for the further migration.

Thank you.

Regards,
Vedad

Vedad
Top achievements
Rank 3
Bronze
Bronze
Iron
 asked on 13 Aug 2024
1 answer
111 views
Hi, there, so atm I'm trying to implement a custom filter menu, with kendo multiselect component, but I'm having some issues. So, what's happening it's that the filtering it's not working properly and I think the issue comes beacuse it's not getting the right currentFilter state. When I open the filter button it seems to do the filtering ok, but when I reopen the button, the filters selected previosly don't appear in the ui, despite the filtering persisting and I'm not able to unselect any filter at all, and if i try to filter again selecting new values it will just add the values to the currentFilter and perfoms the filtering adding the new values, plus the ones before. 


custom-component.ts

export class CustomMultiSelectFilterComponent implements AfterViewInit {

  @Output() public handleFilterChange = new EventEmitter<CompositeFilterDescriptor>()

  @Input() public data: string[] = []
  @Input() public textField: string = ""
  @Input() public valueField: string = ""
  @Input() public filter: CompositeFilterDescriptor = { logic: "or", filters: [] }
  @Input() public preFilterValue: string | null = null
  @Input() public filterService: FilterService
  @Input() public currentFilter: CompositeFilterDescriptor = { logic: "or", filters: [] }

  public constructor(
    filterService: FilterService
  ) {
    this.filterService = filterService
  }

  public filterChange(filter: CompositeFilterDescriptor): void {
    this.filter = filter
    this.data = filterBy(this.data , filter)
    this.handleFilterChange.emit(filter)
  }

  public onChange(values: string[], filterService: FilterService): void {
    filterService.filter({
      filters: values.map((value) => ({
        field: this.valueField,
        operator: "contains",
        value,
      })),
      logic: "or",
    })
  }

  public ngAfterViewInit(): void {
    if (this.filterService) {
      this.filterService.changes.subscribe((filter: CompositeFilterDescriptor) => {
        this.currentFilter = filter
        console.log("Current Filters:", this.currentFilter)
      })
    }
  }

}


custom-filter.html

<kendo-multiselect
  [data]="data"  
  [valuePrimitive]="true"
  [textField]="textField"
  [valueField]="valueField"
  [value]="filter | filterValues"
  (valueChange)="onChange($event, filterService)"
  >
</kendo-multiselect>

table.html


<kendo-grid
  kendoGridSelectBy="id"
  [kendoGridBinding]="users"
  filterable="menu"
  [sortable]="true"
  [resizable]="true"
  (selectionChange)="selectionChange($event)"
  [selectable]="selectableSettings"
  [selectedKeys]="[selectedKeyArray]"
  (filterChange)="handleFilterChange($event)"
  [filter]="filter"
>
  <kendo-grid-column-group title="{{ 'literal:Users | Total:' | translate }} {{ users.length }}" [columnMenu]="true">
    <kendo-grid-column field="roles" title="{{ 'literal:Roles' | translate }}" [width]="220" [headerStyle]="{ 'font-weight': 'bold' }">
      <ng-template kendoGridFilterMenuTemplate let-filter="filter" let-filterService="filterService">
        <app-custom-multiselect-filter
          [data]="rolesToFilter"
          textField="rolesToFilter"
          valueField="filterRoles"
          [preFilterValue]="preFilter"
          [filterService]="filterService"
          [currentFilter]="filter"
          >
        </app-custom


Yanmario
Telerik team
 answered on 02 Jan 2024
0 answers
163 views

Howdy, I am trying to make a right click context menu when you right click on an scheduled event in the scheduler.  I have gotten it mostly working however when I right click on an event the context menu appears about 25 pixels or so below the mouse cursor(see screenshot).  I would prefer it to work like every other context menu which is aligned with the mouse cursor.  The code below seems pretty basic.  In testing I also removed all CSS to ensure there wasn't something causing issues there.  Due to the nature of the context menu I can't inspect the element properly in Chrome's console.  The target element is the scheduled event which I can confirm through console.

 

So how do I make the right click menu actually show up along the mouse when clicking an appt?

 

I have spent the past two days of stripping code and adding it back so in my code below there will be some things that aren't necessary but it shouldn't bog down any troubleshooting.
import { Component, ViewChild, ElementRef, ViewChildren, QueryList } from '@angular/core';
import { ApptDetail } from '../../interfaces/apptdetail.interface';
import { SchedulerEvent, } from '@progress/kendo-angular-scheduler';
import valueHelpers from '../../shared/value-helpers';
import { ApptService } from '../../interfaces/services/appt.service';
import { GenericPagedResponse } from '../../interfaces/pagedresponse.interface';
import { Client } from '../../interfaces/client.interface';
import { ClientService } from '../../interfaces/services/client.service';
import { ContextMenuComponent, ContextMenuSelectEvent, ContextMenuPopupEvent } from '@progress/kendo-angular-menu';

@Component({
  selector: 'app-appointments',
  templateUrl: './appointments.component.html',
  styleUrls: ['./appointments.component.css']
})
export class AppointmentsComponent {
  public appointments: ApptDetail[] = [];
  selectedDate: Date = new Date();
  public contextMenuEvent!: SchedulerEvent;
  @ViewChild(ContextMenuComponent, { static: true }) apptContextMenu!: ContextMenuComponent;
  @ViewChild('apptScheduler', { read: ElementRef }) apptScheduler!: ElementRef;
  @ViewChildren('apptEvent', { read: ElementRef }) apptEventElements!: QueryList<ElementRef>;

  apptContextMenuItems: any[] = [
    {
      text: "Cashout Appointment",
      value: "cashout"
    },
    {
      text: "Edit",
      value: "edit",
    },
    {
      text: "Delete",
      value: "delete"
    },
    {
      text: "Send SMS Reminder",
      value: "sendSMS"
    },
    {
      text: "Send Email Reminder",
      value: "sendEmailReminder"
    },
  ];


  ngOnInit() {
    this.loadApptData();
  }

  constructor(private apptService: ApptService) { }

  loadApptData() {
    console.log("Load appt data");

    const fromDate = valueHelpers.getStartOfWeek(this.selectedDate);
    const toDate = valueHelpers.getEndOfWeek(this.selectedDate);


    this.apptService.getApptsForCalendar(fromDate, toDate).subscribe((data: GenericPagedResponse<ApptDetail>) => {
      this.appointments = data.data;


      // Update the schedulerEvents array with the new data
      this.updateSchedulerEvents();
    });
  }

  private updateSchedulerEvents() {
    this.schedulerEvents = this.appointments.map(appointment => {

      const startDateTime = new Date(appointment.startDateTime); // Convert to Date object
      const endDateTime = new Date(appointment.endDateTime); // Convert to Date object


      return {
        id: appointment.apptDetailId.toString(),
        start: startDateTime,
        end: endDateTime,
        title: appointment.clientName + ' <br> ' + appointment.itemName,
        description: appointment.apptNote,       
        resourceId: appointment.employeeId
      };
    });
  }

  public schedulerEvents: SchedulerEvent[] = [];

  onDateChange(event: any) {
    console.log(event);
    if (this.selectedDate != event.selectedDate)
      this.selectedDate = event.selectedDate;
    console.log('Selected Date:', this.selectedDate);
    this.loadApptData();
  }


  public onApptContextMenuSelect(e: ContextMenuSelectEvent): void {
    if (e.item.value == "edit") {

    }
    else if (e.item.value == "delete") {

    }
    else if (e.item.value == "cashout") {

    }
    else if (e.item.value == "sendSMS") {

    }
    else if (e.item.value == "sendEmailReminder") {

    }

  }
  public onEventContextMenu(event: any): void {
    this.contextMenuEvent = event; // Save the event for later use

    const targetElement = event.target;

    // Get the unique identifier from the custom attribute
   // const apptId = targetElement.getAttribute('data-appt-id');

    // Find the corresponding 'apptEvent' element based on the 'data-appt-id' attribute

   // console.log(apptId)
    
    if (targetElement) {

      
      this.apptContextMenu.show(targetElement);
    }

    event.preventDefault();
  }

}

<kendo-scheduler [events]="schedulerEvents" (dateChange)="onDateChange($event)" [selectedDate]="selectedDate"
                 (contextmenu)="onEventContextMenu($event)" #apptScheduler>

  <kendo-scheduler-week-view> </kendo-scheduler-week-view>

</kendo-scheduler>


<kendo-contextmenu #apptContextMenu [items]="apptContextMenuItems"  (select)="onApptContextMenuSelect($event)">

</kendo-contextmenu>


Sean
Top achievements
Rank 1
 asked on 06 Aug 2023
1 answer
87 views

Hi,

i'm trying to order the items of the "columns" option of angular kendo grid columnMenu , like the jQuery version.

There is a way to do that?

Thanks.

Hetali
Telerik team
 answered on 28 Jun 2023
0 answers
210 views

cssClass not working in kendo-menu-item (cssStyle works)

HTML:

<kendo-menu>
<kendo-menu-item text="1" cssClass="x">
<kendo-menu-item text="1.1"></kendo-menu-item>
<kendo-menu-item text="1.2"></kendo-menu-item>
</kendo-menu-item>
</kendo-menu>

LESS:

.x {
background-color: red;
}

Module:

import { MenusModule } from '@progress/kendo-angular-menu';

const telerikModules = [
...
MenusModule,
...
];

@NgModule({
imports: telerikModules,
exports: telerikModules,
})
export class TelerikModule {
}

 

Dmitry
Top achievements
Rank 1
 updated question on 12 Mar 2023
1 answer
191 views

Hi,

I have a kendo-dropdownlist and I want to override the style of the kendo-popup. I want to change the font as well as change the style for the selected item (see attached file) like the background color, etc...

How do I go about doing this? I've tried styling using pseudo ::ng-deep, :host ::ng-deep to using the classes .k-popup, the li's .k-list-item, etc..

Thanks!

 

Jaime

Hetali
Telerik team
 answered on 15 Feb 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?