adding filter by ressource
pws2016 opened this issue · 1 comments
Hello,
i using the premium version and i want integrate the fullcalendar to hotel room booking system , so i use resource Event solution as room number and i have on resource type of room..
I want create select field in my html to can filtring events by ressource (type room)
I have this code:
` var calendar = new FullCalendar.Calendar(calendarEl, {
height: 'auto',
locale: 'it',
now: "<?php echo date('Y-m-d')?>",
editable: false, // enable draggable events
aspectRatio: 1.8,
allDaySlot:true,
allDayDefault: true,
// scrollTime: '00:00', // undo default 6am scrollTime
headerToolbar: {
left: 'today prev,next',
center: 'title',
right: 'resourceTimelineWeek,resourceTimelineTenDay,resourceTimelineMonth,resourceTimelineYear'
},
initialView: 'resourceTimelineTenDay',
views: {
resourceTimelineWeek: {
slotDuration: '12:00'
},
resourceTimelineTenDay: {
type: 'resourceTimeline',
duration: { days: 10 },
buttonText: '10 gg',
slotDuration: '12:00'
},
resourceTimelineYear: {
buttonText: 'Anno',
}
},
resourceAreaHeaderContent: 'Rooms',
resourceAreaWidth: '20%',
resourceAreaColumns: [
{
field: 'title',
headerContent: 'Numero'
},
{
field: 'type',
headerContent: 'Type'
}
],
resources: { // you can also specify a plain string like 'json/resources.json'
url: '/calendar/rooms',
failure: function() {
document.getElementById('script-warning').style.display = 'block';
}
},
events: { // you can also specify a plain string like 'json/events-for-resources.json'
url: '/calendar/reservations',
failure: function() {
document.getElementById('script-warning').style.display = 'block';
}
}
});
calendar.render();
});
and json ressource as this format:
[{"id":3,"title":"A1","type":"Single"},{"id":4,"title":"B1","type":"Double"},{"id":6,"title":"A2","type":"Single"}]`
How i can solve this?
Please refer to the support page and use Stack Overflow for help. If this is a bug, please supply a runnable, stripped-down demonstration.