AngularJS中全日历在月视图和周视图之间切换不起作用。
创始人
2024-10-27 16:01:38
0

在AngularJS的fullcalendar插件中切换月视图和周视图时,需要在viewRender回调函数中使用renderView方法来重新绘制视图。

以下是示例代码:

在HTML模板中添加以下代码:

在控制器中添加以下代码:

$scope.calendarOptions = {
  header: {
    left: 'prev,next today',
    center: 'title',
    right: 'month,agendaWeek,listWeek'
  },
  defaultView: 'month',
  editable: true,
  eventStartEditable: true,
  eventDurationEditable: true,
  viewRender: function(view, element) {
    if (view.name == 'agendaWeek') {
      $('#myCalendar').fullCalendar('renderView');
    }
  }
};

在上述代码中,我们在viewRender回调函数中检查当前视图的名称,如果它是'agendaWeek'周视图,则调用renderView方法重新绘制视图。

这样就可以在AngularJS的fullcalendar插件中切换月视图和周视图了。

相关内容

热门资讯

透视解迷!wepoker辅助器... 透视解迷!wepoker辅助器官方(透视)哈糖大菠萝挂,教程绝活(的确有挂)-哔哩哔哩1、让任何用户...
hhpoker为什么一直输!h... hhpoker为什么一直输!hhpoker透视实战视频(透视)神器-都是科普真的有挂1、让任何用户在...
透视揭露!wepoker破解器... 透视揭露!wepoker破解器有用吗(透视)cloudpoker透视,教程大纲(有挂神器)-哔哩哔哩...
约局吧如何查看是否有挂!竞技联... 约局吧如何查看是否有挂!竞技联盟辅助(透视)app-总是必备有挂1)约局吧如何查看是否有挂有没有挂:...
透视总结!wepoker辅助透... 透视总结!wepoker辅助透视(透视)poker world辅助器,教程方针(今日头条)-哔哩哔哩...
aapoker如何设置胜率!h... aapoker如何设置胜率!hhpoker怎么开透视(透视)工具-一贯详情是有挂1、玩家可以在aap...
透视关于!德州透视hhpoke... 透视关于!德州透视hhpoker(透视)pokemomo辅助软件,教程窍门(了解有挂)-哔哩哔哩po...
hhpoker免费透视脚本!h... hhpoker免费透视脚本!hhpoker有透视的吗(透视)软件-原来辅助真的有挂在进入hhpoke...
透视解谜!pokeplus脚本... 透视解谜!pokeplus脚本(透视)聚星ai辅助工具收费多少,教程策略(有挂秘籍)-哔哩哔哩聚星a...
wepoker透视器免费!po... wepoker透视器免费!pokemmo辅助器(透视)攻略-都是揭幕是真的挂1、全新机制【wepok...