Tips & Tricks

Open ProcFu calendar items in new tab

App Builder & Automation Expert

Stay Updated with ProcFu!

Subscribe to our newsletter for the latest tips, updates, and automation insights.

Subscribe Now

By default, when you click on an event in a ProcFu calendar, it opens in the same tab. You can override this behavior to open items in a new browser tab.

Here's how you can do it: Add the following JavaScript code to the on-render event of your calendar screen.


var calendarId = document.querySelector('.pfcal').id;
var calendarVarName = 'calendar' + calendarId.replace('cal', '');
var calendarInstance = window[calendarVarName];

if (calendarInstance) {
    calendarInstance.setOption("eventClick", function(e){
        var itemId = e.event._def.extendedProps.item_id;
        var url = "https://procfu.com/APP-ID/SCREEN/" + itemId;
        window.open(url, "_blank");
    });
}
        

How it works:

  • Finds the calendar’s id dynamically from the rendered HTML (.pfcal class).
  • Uses the global JavaScript variable for the FullCalendar instance.
  • Overrides the eventClick handler at runtime.
  • Opens the clicked event’s item details page in a new browser tab.

Love using ProcFu Guide?

Share your testimonial and let us know how ProcFu has helped you.

Share Your Testimonial

Built with ❤️ by Thaha for the Community