• New Commercial Services Section

    We have now opened a commercial services section here on the forum. If you have a Fabrik project that you wish to have someone work on for you, post it under Help Wanted. If you are an application developer and wish to earn some money helping others, post your details under Fabrik Application Developers.

    Both of these are unmoderated. It will be up to both parties to work out the details and come to an agreement.

fullcalendar drag-drop not working

skyrun

Active Member
This is my first calendar. It looks very promising, but the ability to drag and drop items to move them from one day to the next or a different time (or extend the time by moving the bottom of the event) doesn't seem to be working. i get a O with a line (the 'not' symbol when i drag the event.) i notice on fullscreen.io that this works.

i have set readonly to be 'no' and don't see js errors.

i am on J!3.7.4 and php 7.0.21. does the visualization perhaps need to be updated to a newer version of fullcalendar (3.4.0 is the latest from april 2017)? or am i doing something basic wrong.

Thought i would ask before i dug into it too far.
 
Well, FullCalendar provides events that fire for drag events. But the application backing FC has to implement what actually happens when those events fire. There's nothing built in to FC that changes event dates on the server - the demo you see on their page just moves the graphics around. The app using FC has to implement the AJAX and server side logic to actually change anything.

And, it turns out, this is not a trivial thing to do. It's not as simple as just updating the start / end dates. For instance, you may have validations on your form which restrict the dates and times (like to prevent overlap with other events), or validations on other fields, like maybe "attendees" that figures out who is and isn't available in that time slot. Or you may have form plugins that fire, like confirmation emails to event participants, that need to run when dates are changed. Or calc elements that need to run when dates are changed. Etc etc.

And the only way for Fabrik to do all that is through a form submission. Which can't be done automagically in response to an FC drag event.

So the only way it might be possible to implement this would be a specific "allow dragging" option, that completely bypassed all of the above - so by enabling it you are basically saying you don't want any of that stuff to happen, and are completely OK with changing dates and times with no other actions being taken. And add some code that just updates the dates for that row, without going through any kind of form submission processing.

The only other option I can think of would be to automagically open an edit popup for that form if the event is dragged, with the start and end dates modified to suit, which has to be submitted for the changes to take effect.

This is one of those features I'll look at implementing if someone wants to fund it.

-- hugh
 
i keep forgetting that you can't just reply to the note... i had replied yes, i am very interested but you didn't get it. so here's my note.
-----------
i like option 1. the 'enable drag' where the user should beware. i am creating a 'shadow table' from my main table that has just the dates and times, so that users can change the sched without hitting my main production tables.
the drag/drop should work on all places month/week/day and on week/day and be able to change time and length which fullcalendar.io does on the ui side. plus i would like to update to the latest fullcalendar if that's not already part of calendar visualization.

happy to fund that and of course contribute the code back to fabrik.

do you have an estimate? i am ready to go.
you can see the current code that is in test at https://testlocation.skyrun.com/skytrax-reservations/inspection-schedule if your logon works.
 
Right now is not great - I'm about to head to the UK for two weeks (visit with my kids and mom), and I just got back from two days off chasing the eclipse (well worth it, got a cloud-free view from right on the centerline, and got some AWESOME pics ... wound up driving about 1400 miles all told, but worth every mile) ... so I'm in catch-up mode today, then leave on Saturday, then will be in catch-up mode when I get back for a while. I'll keep support ticking over while I'm travelling, but won't have time for any custom work.

So it'll be at least 3 weeks before I could devote any time to this.

Meanwhile, I'll poke around in the code and see what I think is involved, and give you an estimate.

-- hugh
 
thanks hugh, enjoy your trip. i added {"editable":true} to fullcalendar options and i can now drag and drop (with a few things that don't work well yet), but as you know, you'll have to implement the eventDrop and eventResize callback events to update the data in the fabrik list after events are moved.

for your quote, here is a list of things i would like to pay to add to the visualization when you return:
  1. Update fullcalendar version from 2.7.2 (over a year old) -> 3.5 (current version)
  2. Dragging and resizing and event on month/week/day calendar updates the fabrik data date/time so the change is 'permanent'. I don't need any other fabrik plugins to be run or data to be validated. just for the calendar datetime eleements to change. you can make that an option in the plugin if you like with a tooltip warning that this only changes the data, doesn't do anything else. (although that seems obvious to me, i'm sure you deal with lots of different perspectives of what's obvious...)
  3. Ability to click on a day or week on the month calendar and go to the day or week view. same for clicking on a day on the week view. i think this requires adding an <a> element to the day number with this data-goto="{"date":"2017-09-03","type":"day"}" that calls gotoDate (or something like that... selecting a day works on fullcalendar.io to move to a date.
  4. Would like the option for the link on the calender event to open in the same/parent window vs. a new window.
  5. Ideally i would like to change the text that shows on the event also, perhaps through a label concat override (for consistency with the database join element) like {srms_inspections___property}: {srms_inspections___assigned_to}
  6. Formatting: there is a .calendar-message div under the header for the visualization that needs to be display:none by default. it shows a small short bar over the top of every calendar view currently.
  7. On the filters, the title of the visualization is shown again. this is redundant and not consistent with other fabrik filter displays. the visulization title should be removed from the filters.
 
Last edited:
OK. it'll take me a week to catch up with normal workload once I get back, then I'll take a look at this list.

(although that seems obvious to me, i'm sure you deal with lots of different perspectives of what's obvious...)

Lol. Yes. I can guarantee that even with a warning in the tooltip and the wiki, people who use that feature will post complaining that it doesn't run their validations and email plugins when they change the dates with drag and drop.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top