Hi there, how to create onEventClick handler for calendar?
Hey there, can you describe the use case a little more @kasim? We don’t have a trigger available for onEventClick right now, but we do have one for “On event created”, “On event update”, and “On event delete”.
as an example of what we could use onEventClick for, clicking to select a calendar event could show the location of that event on a map component.
Ah, I’m glad that you mentioned that! There is a property for the selected event {{calendar1.selectedEvent}}
, so you can use the data from that to populate other components. However, I’m not sure if there is a location field here…
Yes, the calendar has selectedEvent
property that we can use. But the case is:
We have the a list of orders, the calendar, the map component and the card that shows an order details. We would like to show the orders in the calendar and on the map at the same time. So we have a calendar event and a map marker for the order. Click on the calendar event or on the marker has to show the order details on the card.
How to detect in the card which order is clicked?
{{ calendar1.selectedEvent || map.selectedPoint }} - this is not working, it will always handle calendar only and will not handle clicks on the map.
But it is possible to implement if we has onClick callbacks. We could update temporary state value with the clicked order Id and use the state value in the card to show the order details. The map has such callback onPointSelect
, but the calendar has no.
The issue could be partially solved if we can set which calendar event is selected. But it’s not possible too.
Hi @kasim let me know if I’m following you correctly here. Right now if you use calendarName.selectedEvent.id inside of a temporary state, the entire temporary state value will recalculate whenever that value changes. So each time you select a different event, if the temporary state value was loading order details for a certain event id then those order details would update to be of the selected event’s details.
I don’t think there is any way to change the selected event, but if you select an event inside the calendar directly it would be able to change the order details in the “card” or map
The case is: we have two orders: order1 & order2. They are on the map and on the calendar. Click on a map marker or on a calendar event has to open the selected order details on the card.
I have to find out which of the orders has been clicked last time either on the map or in the calendar.
+1 for this. Would really appreciate an onSelect option
+1. Rellay need to change selectEvent.
+3. attempting to open modal on click
I've discovered a workaround for this:
Create a Query JSON with SQL query with calendar.selectedEvent as one of the variables, and set the query to run when inputs change.
Example: