brendan.feltrupexum PRO
Joined 8/2/2021
brendan.feltrupexum PRO said almost 3 years ago on FullCalendar with StimulusJS :
Great tutorial! This is the one that really pushed me to become a member. I was wondering as you stated about adding a close button on the modal. As I see you have a modal running through javascript that adds a style.display="block" to the modal to open. Since thats handled partly through the js code would you need to write that in js too. Sorry I am really lost when it comes to that part. Any help is appreciated. 

brendan.feltrupexum PRO said almost 3 years ago on FullCalendar with StimulusJS :
  Sorry in advance! JS is not my strong suit. I'm still learning and its hard to keep up with all of it. 

This looks like it would work, but it keeps throwing an error with unknown option "closeModal". The modal does close but it seems to be refreshing the page to do this. I assume thats not supposed to happen. I see you declared "dismiss" in the targets but there is no further reference, maybe Im not seeing a hook to that. Originally when loading this I got another error about the closeModal not defined. 

I made one edit (in my quest to see what I am doing wrong) which still reads the same in source from reading stimulus/rails docs. You tell me if this is better or worse syntax?  
<%= button_tag "Cancel", data: { action: "calendar#closeModal"} %>

Thanks again!