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

Add events programmatically via a button

0 Answers 94 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
R
Top achievements
Rank 1
R asked on 28 Jan 2021, 11:50 AM
In my project I have the Kendo Scheduler widget, I am trying to add an manual 'Add event' button similar to this that has been done in Jquery. https://docs.telerik.com/kendo-ui/controls/scheduling/scheduler/how-to/editing/add-event-programatically

The methods described in the Angular docs for the Scheduler show methods that are attached to the ($event) handlers specific to the Scheduler i.e `(slotDblClick)="onSlotDblClick($event)"`. 

In terms of adding events it mentions to call the addEvent() method.

So I have tried something like: 

    public addEventHandler({ sender, start, end, isAllDay }: EventClickEvent): void {
        this.closeEditor(sender);
    
        this.formGroup = this.formBuilder.group({
            'Start': [start, Validators.required],
            'End': [end, Validators.required],
            'StartTimezone': new FormControl(),
            'EndTimezone': new FormControl(),
            'IsAllDay': isAllDay,
            'Title': new FormControl(''),
            'Description': new FormControl(''),
            'RecurrenceRule': new FormControl(),
            'RecurrenceID': new FormControl()
        });
    
        sender.addEvent(this.formGroup);
    }

This does not work as the sender arguments are specific to the methods in Kendo Scheduler. 

Any idea's

The docs are at: 
https://www.telerik.com/kendo-angular-ui/components/scheduler/editing/editing-reactive-forms/#toc-adding-new-events

No answers yet. Maybe you can help?

Tags
Scheduler
Asked by
R
Top achievements
Rank 1
Share this question
or