Prevent add of event after user clicks on the calendar

  • 1
  • Question
  • Updated 2 years ago
  • Answered
Is there a way to prevent the the addition of an event to the calendar based on a condition such as an event already existing on the calendar.

I am already running a javascript snippet before the custom popup comes up to add an event when the user clicks to add an event and I can figure out if the event is new or not.

How do I cancel the addition of the event to Prevent the add a new event popup from happening?

Thanks.
Photo of Sofware Developer Guy

Sofware Developer Guy

  • 1,354 Points 1k badge 2x thumb

Posted 2 years ago

  • 1
Photo of Sofware Developer Guy

Sofware Developer Guy

  • 1,354 Points 1k badge 2x thumb
Any thoughts anybody? 
Do I need to re-phrase the question?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Hey Leo!

I answered on the other thread, but reading this reminds me that you can conditionally render items with skuid based on whether the row in context is new or not. We're using that as a way to show certain fields and options when editing an existing appointment, and show other options when creating a new appointment. Shoot me an email if you want to set up a screen meeting, and I'll show you.
Photo of Sofware Developer Guy

Sofware Developer Guy

  • 1,354 Points 1k badge 2x thumb
Thanks Matt for your help!

Was able to solve the problem.  Based on this solution:  https://community.skuid.com/skuid/topics/calendar-popup-showing-before-deferred-promise-resolved

If your skuid snippet returns a deferred promise Reject then the skuid popup won't display.  That is one way of preventing the popup from showing.