none
Calendar List redirection to another page after edit or newitem

    Question

  • Hello,

    I am creating a SharePoint Online AddIn with Visual Studio 2015 Pro in which I use fullcalendar.js to show calendar entries from a SharePoint calendar list.

    My Problem is that if I create a new item on the SharePoint calendar list I am redirected to the built-in-SharePoint-calendar view. So I would like to manipulate the normal redirection of newitem.aspx and edititem.aspx.

    Unfortunately JSLink is not working with calendar lists and also setting the Source-Parameter in the URL of newform.aspx access is not working or is ignored.

    I also don't know how to copy existing newform.aspx or edititem.aspx in the addin and adding for example necessary JavaScript there. All suggestions that I found in the internet are based on using SharePoint Designer (which is not working at AddIns) or copying form.aspx from the filesystem of the SharePoint on-premise server but I'm using SharePoint Online.

    Do you have any idea how I can prevent redirection afer new or edited items in a calendar view in SharePoint Online?

    Kind regards,
    Robert.

    Wednesday, September 7, 2016 1:56 PM

Answers

All replies

  • Hi,

    We can use SPService and jQuery to achieve it.

    Here is a similar thread for your reference:

    https://social.technet.microsoft.com/Forums/msonline/en-US/b3401ce6-d884-485c-a01e-48e5cdad41ab/how-to-redirect-from-list-edit-form-to-another-page-using-jquery-in-sharepoint-2013?forum=sharepointdevelopment

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Thursday, September 8, 2016 8:49 AM
    Moderator
  • Hello Dennis,

    thank you very much for your suggestion!

    Now I used "SP.UI.ModalDialog.showModalDialog(options)" to open the Standard calendar newform.aspx and editform.aspx pages to open in modal dialog. In the modal dialog there is no redirection to the standard listview after creating a new or editing an existing calendar entry so the JavaScript fullcalendar stays in the background.

    To update the JavaScript calendar plugin I was able to use the dialogReturnValueCallback Option of SP.UI.ModalDialog.showModalDialog, so that fit my needs.

    But in the modal dialog there is one additional problem. If I select "delete item" then there is a postcallback to the normal calendar listview and I think I'm not able to "manipulate" buttons/buttonfunction with JavaScript from the site which is calling the editform.aspx in modal dialog and I'm not able to modify the standard editform.aspx file in the AddIn.

    Kind regards,
    Robert.

    Thursday, September 8, 2016 3:12 PM
  • Hi Robert,

    We can customize a new edit form for the list in SharePoint Hosted Add-in, and then using some JavaScript to monitor the "Delete Item" button click event.

    The following blog for your reference:

    Add Custom New/ Edit/ Display Form To List Using SharePoint Hosted App

    http://www.c-sharpcorner.com/article/add-custom-new-edit-display-form-to-list-using-sharepoint-ho/

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Marked as answer by RoMeH Friday, September 16, 2016 2:02 PM
    Friday, September 9, 2016 8:38 AM
    Moderator
  • Hello Dennis,

    thank you, that sounds good.

    Do you know if it's also possible to access the sourcecode of the standard "editform.aspx" of this AddIn-SharePoint-List, so that I don't have to create a complete new "editform.aspx" and also optain the original layout and functionality of the editform?

    Kind regards,
    Robert.

    Friday, September 9, 2016 2:45 PM
  • Hi Robert,

    Per my knowledge, we have to customize a new edit form to achieve it.

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, September 12, 2016 8:57 AM
    Moderator
  • Hello Dennis,

    thank you for your answers and your patience!

    Kind regards,
    Robert.

    Friday, September 16, 2016 2:02 PM