question

Michael-2694 avatar image
0 Votes"
Michael-2694 asked Michael-2694 commented

"+ Add" button in fullcalendar in SharePoint 2016 page

Hi experts,

I'm using fullcalendar plugin to create a customized calendar because the built-in SharePoint calendar view does not meet several requirement. However, in the built-in calendar, I see there's a "+ Add" button when I hove over on a cell (refer to the circled part in below screenshot)

16040-image001.png

And when I click on this button, the form to add new event at specified time pops up.

16129-image002.png

So my question is how to add this feature in fullcalendar?

Thanks,
Michael


office-sharepoint-server-development
image001.png (23.2 KiB)
image002.png (60.6 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AmosWu-MSFT avatar image
0 Votes"
AmosWu-MSFT answered Michael-2694 commented

Because fullcalendar is a three-party library, I suggest you go to the library’s GitHub to ask how to add a ‘+ Add’ button to this control.
After you have added the button,you could use SP.UI.ModalDialog.showModalDialog() to create a dialog to add a new item.
SP.UI.ModalDialog.showModalDialog() document for your reference:https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/ff410058(v=office.14)

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @AmosWu-MSFT,

thanks for the answer. I know how to add the button to fullcalendar. To be more specific, what I wanted to know is that in SP built-in calendar, if I select a time slot (say from 8AM - 9AM) and click on "+ Add" button, in the new item form, the "Start Time" and "End Time" are filled in automatically by default with 8AM and 9AM. So how this time is passed to the New Item form?

Thanks,
Michael

0 Votes 0 ·

You could append start time to the calendar list new form url like:
http://sp/Lists/cal2/newForm.aspx?StartTime=7%20AM

Then you could get the start time from url and set the start time column value as excepted.And the end time SharePoint will assigns endtime to one hour after starttime automatically.
Code for your reference:codeaddinnewform.txt
Test Result(Because I don’t use fullcalendar, I use URL access directly to simulate the test):
16634-test36.gif


0 Votes 0 ·
test36.gif (56.9 KiB)

Thanks a lot!

0 Votes 0 ·