Smart UI Components & Libraries – Grid, Scheduler, Gantt, Kanban for Angular, React, Next.js, Vue, Blazor, JavaScript › Forums › Kanban › What’s the Angular way to add context menu to Kanban?
- This topic has 1 reply, 2 voices, and was last updated 2 months, 1 week ago by
Markov.
Viewing 2 posts - 1 through 2 (of 2 total)
-
AuthorPosts
-
September 19, 2025 at 10:39 am #112969
natejacobson
ParticipantHow can I customize the appearance of Smart Kanban?
September 23, 2025 at 5:52 pm #112975Markov
KeymasterIn Smart Angular, the recommended way to add a context menu to the Kanban board is by handling the onContextMenu event of the <smart-kanban> component and then showing your own Smart.Menu (or Angular menu) bound to the event.
import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { KanbanModule } from 'smart-webcomponents-angular/kanban'; import { MenuModule } from 'smart-webcomponents-angular/menu'; import { AppComponent } from './app.component'; @NgModule({ declarations: [AppComponent], imports: [BrowserModule, KanbanModule, MenuModule], bootstrap: [AppComponent] }) export class AppModule {} Template: <smart-kanban #kanban [columns]="columns" [dataSource]="data" (onContextMenu)="openContextMenu($event)"> </smart-kanban> <smart-menu #menu [modal]="true" [mode]="'dropDown'"> <smart-menu-item>Edit Task</smart-menu-item> <smart-menu-item>Delete Task</smart-menu-item> <smart-menu-item>Assign To...</smart-menu-item> </smart-menu> import { Component, ViewChild } from '@angular/core'; import { KanbanComponent } from 'smart-webcomponents-angular/kanban'; import { MenuComponent } from 'smart-webcomponents-angular/menu'; @Component({ selector: 'app-root', templateUrl: './app.component.html' }) export class AppComponent { @ViewChild('kanban', { static: true }) kanban!: KanbanComponent; @ViewChild('menu', { static: true }) menu!: MenuComponent; columns = [ { label: 'To Do', dataField: 'toDo' }, { label: 'In Progress', dataField: 'inProgress' }, { label: 'Done', dataField: 'done' } ]; data = [ { id: 1, text: 'Create new feature', status: 'toDo' }, { id: 2, text: 'Fix bug #42', status: 'inProgress' }, { id: 3, text: 'Release version 1.0', status: 'done' } ]; openContextMenu(event: CustomEvent) { event.preventDefault(); // prevent browser context menu const { originalEvent, target } = event.detail; // You can check target type: card, column, kanban console.log('Context menu target:', target); // Position menu at mouse pointer this.menu.open(originalEvent.pageX, originalEvent.pageY); } }Best regards,
MarkovSmart UI Team
https://www.htmlelements.com/ -
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.