fullcalendar.js를 사용하여 클라이언트 측 필터링을 구현하려고합니다. 내가 사용 초기에 달력을 렌더링 할 수 있습니다jQuery 전체 캘린더 업데이트/필터 캘린더
function getCalendar($venue) {
$('#calendar').fullCalendar({
eventSources: [
{
url: ajaxUrl,
type: "GET",
dataType: "json",
data: {
action: 'loop_events_output',
venue: $venue,
},
beforeSend: function() {
$("#calendar").LoadingOverlay("show", {
color: "rgba(51,51,51,0.8)",
});
},
complete: function() {
$("#calendar").LoadingOverlay("hide");
},
error: function() {
alert('there was an error while fetching events!');
},
}
]
});
}
// execute on load
getCalendar('townsville');
가 지금은 체크 박스의 입력에 따라 달력을 업데이트 할 수 있도록하려면, 여기 내 코드의 두 번째 부분입니다 :
// execute when using filters
$('.calendar-controls input').change(function(){
if (this.checked) {
var checkedVal = $(this).val();
$("#calendar").fullCalendar('removeEvents');
getCalendar(checkedVal);
$('#calendar').fullCalendar('refetchEvents')
}
});
하지만 내가 할 수있는 요청 URL이 변경되지 않는 XHR 요청에서 확인하십시오. /wp-admin/admin-ajax.php?action=loop_events_output & 개최지 = townsville & 시작 = 2016-07-31 & 끝 = 2016-09- 11 & _ = 1472626202164
도움을 주시면 감사하겠습니다.