无法显示listweek和listday按钮fullcalendar angularjs

时间:2017-03-10 15:29:00

标签: javascript angularjs fullcalendar

我正在使用fullcalendar AngularJS。不知何故,我无法获取日历标题上的listWeeklistDay按钮。无法理解我可能出错的地方。

这是config var

$scope.uiConfig = {
  calendar:{
    height: 500,
    eventCalendar: {
        header: {
            left: 'prev,next',
            center: 'title',
            right: 'listWeek listDay'
        },
        views: {
            listDay: { buttonText: 'Day' },
            listWeek: { buttonText: 'Week' }

        },
        defaultView: 'listWeek',
        timezone: "local",
        navLinks: true,
        eventLimit: true,
        hiddenDays: [0, 6],
        allDaySlot:  false,
        minTime: "08:00:00",
        maxTime: "17:00:00",
        eventOverlap: false,
        selectOverlap: false
    }
  }
};

2 个答案:

答案 0 :(得分:0)

您应该删除views选项并添加buttonText这样可以解决您的问题。

$scope.uiConfig = {
    calendar:{
        height: 500,
        eventCalendar: {
            header: {
                left: 'prev,next',
                center: 'title',
                right: 'listWeek listDay'
            },
            buttonText: {
                listDay: 'Day',
                listWeek 'Week'
            },
            defaultView: 'listWeek',
            timezone: "local",
            navLinks: true,
            eventLimit: true,
            hiddenDays: [0, 6],
            allDaySlot:  false,
            minTime: "08:00:00",
            maxTime: "17:00:00",
            eventOverlap: false,
            selectOverlap: false
       }
   }
};

否则,您必须在views中添加更多选项,以便为您提供类似的功能,但这种方式可用于自定义视图

views: {
    listDay: { 
        type:'list', 
        duration:{
            days:1
        }, 
        buttonText: 'Day' 
    },
    listWeek: { 
        type:'list', 
        duration:{
            days:7
        }, 
        buttonText: 'Week' 
    }
},

答案 1 :(得分:0)

还要确保已包含print.css并将其媒体属性设置为" print",即;媒体="打印"

这可能会纠正您的问题。