Dividing days into several sections in FullCalendar

杀马特。学长 韩版系。学妹 提交于 2019-12-30 07:26:07

问题


I want to divide days into sections, for example there are a lot of events in one day, and they take place in different rooms (A, B, C), I want to divide each days into columns A, B, C to separate events from different rooms. There is any way to do this?


回答1:


I had the same prerequesites and I will do this way:

In fullcalendar options:

  • Create a fullcalendar "control" with title, prev, next and today.
  • Create N fullcalendar "events" without navigation, and set each title to each room.

You should apply some tricks to render nice calendars :

  • Calendar "control": hide body fc-content (CSS display:none)
  • Second Calendar and: hide left axis fc-agenda-axis (CSS width: 0px)

In your data and js handling:

  • Fullcalendar "control" must control all others calendars (see How do I set the date of a calendar view from another view using Jquery FullCalendar? )
  • Load events from Room A to Calendar A, Room B to Calendar B, etc.

You can start with this jsfiddle : http://jsfiddle.net/8ZM4x/1/

And then replace events source with yours :

$('#mycalendar1').fullCalendar(
            {
                    events: [     
                          ...
                    ]
           }); 



回答2:


There is a fork of the fullCalendar library that will provide this functionality - they call it a Resource View.

http://tux.fi/~jarnok/fullcalendar-resourceviews/

Check out my answer to this thread for more information.



来源:https://stackoverflow.com/questions/6060204/dividing-days-into-several-sections-in-fullcalendar

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!