จากการเรียกใช้งานข้อมูล ตามหัวข้อบทความแรก เกี่ยวกับ fullcalendar v 2.1.1
การใช้งาน fullcalendar v.2.1.1 กับฐานข้อมูล สร้างปฏิทินกิจกรรม
https://www.ninenik.com/content.php?arti_id=564 via @ninenik
จะมีการใช้งาน events option ในการเรียกไฟล์ข้อมูล กิจกรรม มาแสดงในปฏิทิน
ซึ่งเป็นการเรียกใช้งานจากแหล่งข้อมูลหล่งเดียว แต่ในเนื้อหาตอนนี้ จะแนะนำการ
นำข้อมูลจากแหล่งข้อมูล หลายๆ ที่ หรือหลายไฟล์ มาแสดงในปฏิทินกิจกรรม
ด้วยการใช้งาน eventSources โดยจะมาใช้งานแทน events option
เนื้อหานี้เป็นการศึกษาต่อเนื่อง จะใช้บทความ ตามลิ้งค์ด้านบนประกอบ หรือต่อเนื่องจาก
บนความด้านบน
รูปแบบการใช้ข้อมูจากแหล่งเดียว และการใช้งาน events option
$(function(){
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay',
},
events: {
url: 'data_events.php?gData=1',
error: function() {
}
},
eventLimit:true,
lang: 'th'
});
});
รูปแบบการใช้ข้อมูจากแหล่งข้อมูลกิจกรรม หลายๆ ข้อมูล
และการใช้งาน eventSources option
$(function(){
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay',
},
eventSources: [
'data_events.php?gData=1',
'data_events2.php?gData=1'
],
eventLimit:true,
lang: 'th'
});
});
ตัวอย่าง