brendan.feltrupexum PRO
Joined 8/2/2021
brendan.feltrupexum PRO said over 2 years ago on FullCalendar with StimulusJS :
For those wanting to make the box selectable and the date number zoom to the daily grid this is my edits: 

selectable: true,

navLinkDayClick: function(date, jsEvent) {
        calendar.changeView('timeGridDay', date);
        },

    
      select: function(info) {
        _this.modalTarget.style.display = "block"
        _this.start_timeTarget.value = info.start
        _this.end_timeTarget.value = info.end
        },

I added the selectable to the options and added the select function with the modal part and changed the naveLinkDayClick to the changeView

brendan.feltrupexum PRO said over 2 years ago on FullCalendar with StimulusJS :
  On top of it reloading its actually adding events to the calendar. Like its submitting the blank form. 

brendan.feltrupexum PRO said over 2 years ago on FullCalendar with StimulusJS :
I tried just using the one supplied along with the event.preventDefault and still errors and adding blank events into calendar. I have spent a few hours reading stimulus controller docs and here is what I have tried to do and still nothing. I could be writing this out wrong, but there is a removeAttribute that can be done and I was thinking this might skip any of the loops. 

calendar_controller.js
select: function (info) {
        _this.modalTarget.style.display = "block"
        _this.start_timeTarget.value = info.start
        _this.end_timeTarget.value = info.end
        }, 


        closeModal(event) {
            event.preventDefault()
            _this.modalTarget.removeAttribute("style");
          },
index.html.erb
<div class="modal-footer">
            <%= button_tag "Close", data: { action: "calendar#closeModal"} %>
            <%= form.submit class: 'btn btn-primary' %>
          </div>

Even after trying to add this. It still sends a post command adding a blank event to the calendar. I cannot wrap my head around this one. By the way this is one of the resources I am following attempting to figure this out: https://tighten.co/blog/stimulus-101-building-a-modal/

brendan.feltrupexum PRO said over 2 years ago on FullCalendar with StimulusJS :
Okay, so tinkering around again I moved it outside the connect() function and it works!!! No more posting and no more adding random events. So my text above for the code is correct, just move
  closeModal(event) {
    event.preventDefault();
    this.modalTarget.removeAttribute("style")
    //_this.modalTarget.style.display = "none"
  }
 to below 
calendar.render() 
}
Make sure its after the } so its outside the loop. 

brendan.feltrupexum PRO said about 1 year ago on Zipping Files :
David, In the case where you have a large amount of files where a background worker might be better, how would you go about setting that up with an email notification? I understand that your demo didn't have users setup in that install.