Custom popup on calendar component

  • 1
  • Question
  • Updated 4 months ago
  • Answered
I am trying to get a custom pop up behaving correctly following the clicking of an event record in our skuid calendar view.

The pop up is a page include and the following query string (which i'm guessing is the problem) is sent: ActivityId={{$Model.All_Events.data.0.Id}}

If my calendar view has 10 cards being displayed with different events, and I click on any card, the pop up will show the same event record every time, regardless of what event card I click.

What do I need to do, to ensure that when an event card within a calendar is clicked, the pop up shows the event associated with the card clicked, and not some random event?
Photo of Glenn Daly

Glenn Daly

  • 1,270 Points 1k badge 2x thumb

Posted 4 months ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Your guess is exactly right. 

The merge syntax you are using - ActivityId={{$Model.All_Events.data.0.Id}} is what we call "Global" syntax. What is nice about this method is that you can use it wherever we process merges throughout the application.  The problem is that you don't have "context".  That merge will always retrieve the Id field from the FIRST row of the "All_Events" model.  (The 0 index).  You get the same event every time.. 

Any data that is connected to a model is going to give you "row context"   If the calendar events in your calendar are bound to the All_Events model - and you simply use the field in braces  like this --- {{Id}}  then the Id field will be specific to the row of the event you clicked on. 

You can test this by simply putting a template in the popup with {{Id}} to make sure different IDs are displayed for each event. 
Photo of Glenn Daly

Glenn Daly

  • 1,270 Points 1k badge 2x thumb
This has resolved the issue, thanks very much for your help :)