2013-05-07 2 views
1

eventSource에 따라 다른 eventClick을 가지며 eventClick이없는 일부 eventSources를 갖는 방법을 찾고 있습니다. 이렇게하면 소스에 따라 다른 팝업을 열어 이벤트를 가질 수 있습니다. FullCalendar - eventSource마다 다른 clickEvent를 갖는 방법

내가이 예를 시작하십시오 eventClick 두 소스에 대한 해고

$(document).ready(function() { 

     $('#calendar').fullCalendar({ 
       height: 600, 
       theme: true, 
       eventSources: [ 
        { 
        url: 'http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic', 
        className: 'fc-event-title-event'     
        } , 
        { 
        url: 'testCalendar', 
        color: 'red', 
        currentTimezone: 'America/New_York', 
        editable: true     
        } 

      ], 

      eventClick: function(calEvent, jsEvent, view) {       
         alert('Event: ' + calEvent.title); 
         alert('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY); 
         alert('View: ' + view.name); 

         //window.open(event.url, 'gcalevent', 'width=700,height=600'); 
         return false; 
        },  

      loading: function(bool) { 
       if (bool) { 
        $('#loading').show(); 
       }else{ 
        $('#loading').hide(); 
       } 
      }   
     });  
    }); 

. 그것은 소스마다 eventClick을 사용자 정의하는 방법이 될 것 같아요,하지만 설명서 및 stackoverflow 및 google에서 무수한 검색에서 그것을 보지 않을거야.

미리 감사드립니다.

답변

1

eventSources에는 eventClick에 대한 옵션이 있다고 생각하지 않습니다. calEvent 개체를 사용하고 source을 확인하여 클릭 이벤트를 처리하는 방법을 결정할 수 있습니다. 그 외에는 fullcalendar가 당신이 찾고있는 기능이 내장되어 있다고 생각하지 않습니다.

희망이 도움이됩니다.

+0

calEvent.source.url을 확인하면 필요한 컨트롤을 제공합니다. 좋은 생각. 여전히 per eventSource eventClick과 같이 유용 할 수 있습니다. 고맙습니다. –

관련 문제