Angular 启动计划自定义按钮
是否可以在启动计划组件中使用完整的日历自定义按钮 我曾尝试通过@ViewChild(“日历id”)使用ElementRef,但我得到了p-schedule对象类型,没有任何fullCalendar方法Angular 启动计划自定义按钮,angular,fullcalendar,primeng,Angular,Fullcalendar,Primeng,是否可以在启动计划组件中使用完整的日历自定义按钮 我曾尝试通过@ViewChild(“日历id”)使用ElementRef,但我得到了p-schedule对象类型,没有任何fullCalendar方法 customButtons: { myCustomButton: { text: 'custom!', click: function() { alert('clicked the custom button!');
customButtons: {
myCustomButton: {
text: 'custom!',
click: function() {
alert('clicked the custom button!');
}
}
},
现在最好的方法是自己制作按钮。 可以使用日历@ViewChild(“日历id”)的ElementRef完成此操作
其中*是启动计划文档的功能-您可以通过以下方式获得完整日历:
@ViewChild('calendar-id') calendar;
ngAfterViewInit(): void {
this.calendar.schedule.fullCalendar('<method>');
}
@ViewChild('calendar-id')日历;
ngAfterViewInit():void{
本.日历.时间表.完整日历(“”);
}
未记录启动计划对象的
计划
成员。我从实现中发现了它。您可以通过Schedule的“options”属性实现您想要的
public options : any = {};
...
ngOnInit() {
this.options.customButtons = {
myCustomButton: {
text: 'myCustom',
icon: 'fa-check',
click: r => {console.log("clicked");}
}
}
在模板中:
<p-schedule #cal [events]="events" locale="es" [height] ="750" [header]="headerConfig" [options]="options">
</p-schedule>
希望能有帮助
<p-schedule #cal [events]="events" locale="es" [height] ="750" [header]="headerConfig" [options]="options">
</p-schedule>