gpt4 book ai didi

javascript - refetchEvents 不更新日历

转载 作者:行者123 更新时间:2023-11-28 04:00:45 25 4
gpt4 key购买 nike

当我点击<h1>时每次都有新的balance对象 calander.fullCalendar('refetchEvents') 未刷新。因此日历 View 中的月份未更改。

var app=angular.module('myApp',[]);
app .controller('myController', ['$scope', '$http', function ($scope, $http) {

$scope.init=function(){
$scope.LeaveBalance=[
{
'month':"JAN",
'pd':06,
'op':04,
'defaultDate':'2017-01-05'
},
{
'month':"FEB",
'pd':06,
'op':04,
'defaultDate':'2017-02-05'
},
{
'month':"MAR",
'pd':06,
'op':04,
'defaultDate':'2017-03-05'
},
{
'month':"DEC",
'pd':06,
'op':04,
'defaultDate':'2017-12-05'
}

];
}

$scope.myfunc =function(balance){
$scope.showLeaveBalance(balance)
}

$scope.showLeaveBalance =function(balance){
calendar= $('#fullCalendar').fullCalendar({
defaultDate: balance.defaultDate,
editable: true,
eventLimit: true,
events: [
{
title: 'SL',
start: '2017-10-01',
// specialevent:'2017-10-15'
},
{
title: 'SL',
start: '2017-10-28',
//specialevent:'2017-10-18'
}
]
});
calendar.fullCalendar('refetchEvents')

}

}])

我的 fiddle 无法工作https://jsfiddle.net/shwwL2z1/2/但我已经正确更新了所有内容。有人可以检查吗?

最佳答案

      $scope.myfunc =function(balance){
//Removes events from the calendar.
uiCalendarConfig.calendars.calendar.fullCalendar('removeEvents');
$scope.showLeaveBalance(balance)
}

了解更多详情click在这里。

关于javascript - refetchEvents 不更新日历,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47136204/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com