
Adding different way but not able to see in browser.
Let me know If I miss anything.

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>
I would like to disable the popup when hovering over the graph point.
how to remove 1 in photo
how to focus on first element of list at open click?
the focus is on bottom
i want to set focus on top of the list when is opened
#projectmultiselect (open)="open(e)" (opened)="opened(e)"
Hi!
I'm using the dropdowntreecomponent with value primitive binding to ngmodel but I get an error when opening the dropdown.
Here is a sandbox showing the error:
https://codesandbox.io/s/empty-field-s3vtcr
ERROR Error: Expected dataItem of type Object to be set. See https://www.telerik.com/kendo-angular-ui/components/dropdowns/api/DropDownTreeComponent/#toc-dataitem
Basically the dataItem is received here as a primitive value and not the complete dataItem.
Thanks

How do I put only and exclusively the value 0 in ase y in bold and different color?
Hi
I have the following data (just an selection):​
0: Object { myDate: Date Fri Jul 28 2023 17:43:24 GMT+0930 (Australian Central Standard Time), myTime: "17:43", myText: "NOT_OCCUPIED" }
​1: Object { myDate: Date Fri Jul 28 2023 17:32:10 GMT+0930 (Australian Central Standard Time), myTime: "17:32", myText: "OCCUPIED" }
​2: Object { myDate: Date Thu Jul 27 2023 19:50:37 GMT+0930 (Australian Central Standard Time), myTime: "19:50", myText: "NOT_OCCUPIED" }
​3: Object { myDate: Date Thu Jul 27 2023 19:33:46 GMT+0930 (Australian Central Standard Time), myTime: "19:33", myText: "OCCUPIED" }
​4: Object { myDate: Date Thu Jul 27 2023 17:41:13 GMT+0930 (Australian Central Standard Time), myTime: "17:41", myText: "NOT_OCCUPIED" }
​5: Object { myDate: Date Thu Jul 27 2023 16:50:35 GMT+0930 (Australian Central Standard Time), myTime: "16:50", myText: "OCCUPIED" }
​6: Object { myDate: Date Thu Jul 27 2023 15:47:44 GMT+0930 (Australian Central Standard Time), myTime: "15:47", myText: "NOT_OCCUPIED" }
which basically just lists when somebody is at their desk (occupied/not_occupied). This is nothing sinister - just a desk sharing situation :) - we would like visualised when the desks are being used. I would now like to have a chart that on the y axis (vertically) has two entries, occupied and not occupied. The x-axis (horizontally) has the date in 4 hour increments. the visualisation then runs from left to right and when it is occupied (eg. above 17:32 - 17:43) I would like there to be a bar shown i.e. filled, when not occupied then nothing shown. The opposite then for not occupied. Something like a stacked bar chart but only with 'gaps' if that makes sense.
Something like this just not so ugly :)
Anybody have any ideas which chart I could use for this?
Thank you
Ursus
