inlineEventSelected problem


#1

Hello,
i have a RadCalendar witch view mode “Inline”

<RadCalendar selectionMode="Single" [eventsViewMode]="'Inline'" [eventSource]="eventSource" row="0" (inlineEventSelected)="onEventClick($event)"></RadCalendar>

i filling this bu my custom events witch looks like

export class TerminarzEvent extends CalendarEvent {
	title: string;
	startDate: Date;
	endDate: Date;
	isAllDay: boolean;
	eventColor: Color;
	id: string;
	constructor(title: string, startDate: Date, endDate: Date, isAllDay?: boolean, eventColor?: Color, id?: string) {
		super(title, startDate, endDate, isAllDay, eventColor);
		this.id = id;
	}
}

how can i get id from my event in inlineEventSelected event?
in my function:

onEventClick = (evt) => {
		console.log(JSON.stringify(evt));
	}

i only get:

{"eventName":"inlineEventSelected","eventData":{"_android":{}}}

#2

Sometimes JSON stringify can confuse you. As mentioned in Docs, you can just access your event data as evt.eventData.


#3

Im getting only a

{"_android":{}}

when i changed

console.log(JSON.stringify(evt));

to:

console.log(JSON.stringify(evt.eventData));

and a evt.eventData.id is undefined :frowning:


#4

RadCalendar won’t know what is TerminarzEvent, all it is going to return is the CalendarEvent. Try .title / .startDate.


#5

ok .title is working but how can i get a id from this event?
I want get from server information about this event and display it on screen, to do this i want to get an id or something unique from this event.

can i modify this to return a TerminarzEvent? or add invisible property to CalendarEvent?