【问题标题】:How can we add dropdown like html on click of fullcalendar-angular CustomButton我们如何在单击 fullcalendar-angular CustomButton 时添加像 html 这样的下拉列表
【发布时间】:2021-03-24 13:11:05
【问题描述】:

我正在研究 fullcalendar-angular 组件,其中我有一个名为 filter 的自定义按钮,单击它时,modal/dialog/menu-items 应该像下拉菜单一样打开。那么我们如何在customButton点击功能下实现呢?有没有办法添加 HTML 以及如何添加?如图所示。

calendarOptions:CalendarOptions = {
        initialView:'dayGridMonth',
        themeSystem:'bootstrap',
        nowIndicator:true,
        //showNonCurrentDates:false,
        fixedWeekCount:false,
        customButtons:{
            myCustomBtton: {
                bootstrapFontAwesome:'fas fa-sliders-h',
                click: function(click,element){
                    //how do i add the code here`enter code here`
                },
            },
        },
        headerToolbar:{
            left:'prev,next today',
            center:'title',
            right:'dayGridMonth,dayGridWeek,dayGridDay,listMonth myCustomBtton'
        },

fullcalendar-angualr custombutton image

【问题讨论】:

    标签: angular9 fullcalendar-5


    【解决方案1】:

    我是 Angular 的新手,但我能够通过在 eventDidMount 挂钩之后调用的函数为下拉列表注入一些 HTML 来创建下拉列表。

    https://fullcalendar.io/docs/event-render-hooks

    如果对你有用的话,我很高兴给你一些示例 CSS/JS 来显示隐藏下拉菜单。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-01-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-21
      • 2017-08-24
      相关资源
      最近更新 更多