Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 启动计划自定义按钮_Angular_Fullcalendar_Primeng - Fatal编程技术网

Angular 启动计划自定义按钮

Angular 启动计划自定义按钮,angular,fullcalendar,primeng,Angular,Fullcalendar,Primeng,是否可以在启动计划组件中使用完整的日历自定义按钮 我曾尝试通过@ViewChild(“日历id”)使用ElementRef,但我得到了p-schedule对象类型,没有任何fullCalendar方法 customButtons: { myCustomButton: { text: 'custom!', click: function() { alert('clicked the custom button!');

是否可以在启动计划组件中使用完整的日历自定义按钮

我曾尝试通过@ViewChild(“日历id”)使用ElementRef,但我得到了p-schedule对象类型,没有任何fullCalendar方法

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>