2017-11-06 4 views
1

balance 개체를 사용하여 매번 <h1>을 클릭하면 calander.fullCalendar ('refetchEvents')는 새로 고치지 않습니다. 캘린더보기에서는 월이 변경되지 않습니다.refetchEvents 캘린더를 업데이트하지 않습니다

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') 

     } 

     }]) 

내 바이올린은 https://jsfiddle.net/shwwL2z1/2/ 작동하지 않습니다하지만 everyting correctly.Can 사람이 그것을 확인 업데이트 한?

+0

바이올린이 작동하지 않습니다. – Dixit

+0

예, '순간이 정의되지 않았습니다.'오류가 발생했습니다. 하지만 순간 플러그인을 추가했습니다. – krish

답변

0

있어 솔루션 : 일, 월 및 연도를 업데이트 할 수 있습니다 $('#fullCalendar').fullCalendar('gotoDate', balance.defaultDate);을 추가함으로써

$('#fullCalendar').fullCalendar({ 
      defaultDate: balance.defaultDate, 
      editable: true, 
      eventLimit: true, 
      //weekends:false, 
      events: [ 
       { 
        title: balance.title, 
        start: balance.startDate, 
        // specialevent:'2017-10-15' 
       },    
       {     
        title: balance.title, 
        start: balance.startDate, 
        //specialevent:'2017-10-18' 
       } 
      ] 
     });  
     $('#fullCalendar').fullCalendar('gotoDate', balance.defaultDate); 

.

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

자세한 내용은 click 여기에 있습니다.

+0

'uiCalendarConfig'는 무엇입니까? – krish