Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7586041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:19:32+00:00 2026-05-30T19:19:32+00:00

I want to be able to drag external elements and drop them on my

  • 0

I want to be able to drag external elements and drop them on my fullcalendar. In the drop callback I request a page that returns the calculated return time (for example: “2012-03-03 08:00:00”) for the event reason type. The date is received and applied to the .end property of the event. And the event is added to the calendar but the event defaults to 2 hours length causing the event to have the wrong endtime (should stretch to next “08:00”). If I switch to weekview the correct endtime is displayed and also if I switch back. Also if I drag the event having thw wrong siplayed endtime to a new position on the calendar, it is rerendered with the correct endtime (“08:00”).

So, does anyone know how to simluate a dragEventStop or whatever is needed for it to rerender correctly?

The code:

drop: function(date, allDay) { // this function is called when something is dropped
        // retrieve the dropped element's stored Event Object
        var originalEventObject = jQuery(this).data('eventObject');

        // we need to copy it, so that multiple events don't have a reference to the same object
        var copiedEventObject = jQuery.extend({}, originalEventObject);

        // assign it the date that was reported
        copiedEventObject.start = date;
        //Fetch endtime from loadReturntime
        var opt = {session: '<%= GetVariable('session') %>', cmd: 'hv_get_returntime', reasoncode_id: ''+jQuery(this).attr('custom:reasoncode')+'', fromtime: ISODateString(date)};                 
        jQuery.get('engine.wsc', opt, function(data) {                                  
            copiedEventObject.end = new Date(data);             
        });

        copiedEventObject.allDay = false;

        // render the event on the calendar

        jQuery('#calendar').fullCalendar('renderEvent', copiedEventObject, true);                                           
        },
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T19:19:33+00:00Added an answer on May 30, 2026 at 7:19 pm

    I found out that the answer is that the callback of jQuery.get() is handled after (of course) the remaining lines of the function drop. Therefor the event is rendered before the callback is handled and setting the end date to the correct one. The solution is to add the rendering in the callback of get(). For example:

    drop: function(date, allDay) { // this function is called when something is dropped
       // retrieve the dropped element's stored Event Object
       var originalEventObject = jQuery(this).data('eventObject');
    
       // we need to copy it, so that multiple events don't have a reference to the same object
       var copiedEventObject = jQuery.extend({}, originalEventObject);
    
       var opt = {session: '<%= GetVariable('session') %>', cmd: 'hv_get_returntime', reasoncode_id: ''+jQuery(this).attr('custom:reasoncode')+'', fromtime: ISODateString(date)}; 
       jQuery.get('engine.wsc', opt, function(data) {                                   
              copiedEventObject.end = new Date(data);               
              // assign it the date that was reported
              copiedEventObject.start = date;                                       
              copiedEventObject.allDay = allDay;
              // render the event on the calendar
              jQuery('#calendar').fullCalendar('renderEvent', copiedEventObject, true);                                                             
       });                              
    },
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a grid of pictures that I want to be able to drag/drop
I want a user to be able to drag and drop plain text (external
I have two container divs and want to drag and drop elements between them.
I have a MovieClip that I want the user to be able to drag
i have a image that i don't want it drag-able or selectable so that
I want to be able to repeatedly drag and drop the same source element.
Greetings, I need to be able to drag and drop items that's contained in
I want to be able to drag and drag App model which is nested
I want to be able to capture the exception that is thrown when a
I've created a child class of QTreeWidget that I want to be able to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.