Tips & Tricks
Open ProcFu calendar items in new tab
Thaha
App Builder & Automation Expert
Stay Updated with ProcFu!
Subscribe to our newsletter for the latest tips, updates, and automation insights.
Subscribe NowBy 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
iddynamically from the rendered HTML (.pfcalclass). - Uses the global JavaScript variable for the FullCalendar instance.
- Overrides the
eventClickhandler at runtime. - Opens the clicked event’s item details page in a new browser tab.