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 7681731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:24:29+00:00 2026-05-31T18:24:29+00:00

I have set up FullCalendar to accept drops, which it does. But the draggable

  • 0

I have set up FullCalendar to accept drops, which it does. But the draggable object, which I have constructed with revert:’invalid’ does not seem to recognize the dates on FullCalendar as droppable, and reverts back. Here is my code:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>

  <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
  <title>mydrag</title>
  <script src="fullcalendar-bundle.js" type="text/javascript"></script>
</head><body>
<div id="mydrag" style="width: 200px; height: 100px; background-color: red;">My Drag</div>
<div id="calendar"></div>


<script type="text/javascript">
function onExternalEventDrop(date, allDay) {
    alert("Dropped on " + date + " with allDay=" + allDay);
}

$('#mydrag').each(function() {

    // create an Event Object (http://arshaw.com/fullcalendar/docs/event_data/Event_Object/)
    // it doesn't need to have a start or end
    var eventObject = {
        title: 'MyDrag Title'
    };

    // store the Event Object in the DOM element so we can get to it later
    $(this).data('eventObject', eventObject);

    // make the event draggable using jQuery UI
    $(this).draggable({
        helper: 'clone',
        //revert: 'invalid',
        revert: function(droppableObj) {
            //if false then no socket object drop occurred.
            if(droppableObj === false) {
                //revert the .myselector object by returning true
                alert('Not a droppable object');
                return true;
            }
            else {
                //droppableObj was returned,
                //we can perform additional checks here if we like
                //alert(droppableObj.attr('id')); would work fine
                //return false so that the .myselector object does not revert
                return false;
            }
         },
        revertDuration: 500,  //  original position after the drag
        start: function(e, ui) {
            $(ui.helper).css('width', $(this).css('width'));
        }
    });

});

$('#calendar').fullCalendar({
    aspectRatio: 2.25,
    header: {
        left: '',
        center: 'title',
        right: 'prev,next'
    },
    columnFormat: {
        month: 'dddd'
    },
    droppable: true,
    drop: onExternalEventDrop
});

</script>
</body></html>

When I drag the draggable element onto the calendar, the element reverts back (suggesting that the calendar date was not recognized as a valid droppable)….but the drop callback is triggered with the expected alert (suggesting that FullCalendar recognized the draggable as valid). I would expect that the draggable should not revert back. Am I doing or expecting something wrong? I have searched all over, but not found anything to explain this. Any help would be greatly appreciated.

Update: Forgot to mention, what I have called “fullcalendar-bundle.js” is a file containing the following:

  • jquery 1.5.2
  • jquery ui 1.8.11
  • fullcalendar 1.5.2 plugin

Another update: I have just tried the FullCalendar 1.5.3 release, but see the same behavior.

  • 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-31T18:24:31+00:00Added an answer on May 31, 2026 at 6:24 pm

    This may help you:

    working version of drag and drop : http://jsfiddle.net/wkKfB/15/

    Solution for dragobj = false is that you need to bind droppable event to the calendar so that draggable knows what DOM object is droppable see working example here: http://jsfiddle.net/CZQkm/3/ && http://jsfiddle.net/DEsdN/12/
    *Until here

    (Your version but with some tweaks. By the way I have jsfiddl-ed your issue here: http://jsfiddle.net/wkKfB/16/) (issue was binding the external event)

    Good documentation reside here: http://arshaw.com/fullcalendar/docs/dropping/droppable/

    Issue was you need to externally add these drag event.

    You can change the css and make it to your use.

    Quote *[From the documentation above around external drag and drop.]* http://arshaw.com/fullcalendar/docs/dropping/droppable/

    >     How can I use this to add events???
    >     
    >     Good question. It is a common need to have an "external list of events" that can be dragged onto the calendar.
    >     
    >     While the droppable option deals with generic jQuery UI draggables and is not specifically tailored to adding events, it is possible to
    > achieve this with a few lines of code. Follow the
    > external-dragging.html example in FullCalendar's download. You can
    > also view the example online.
    >     
    >     In short, you must call renderEvent yourself in the drop callback.
    

    another link: http://arshaw.com/js/fullcalendar-1.5.3/demos/external-dragging.html

    To capture the external event you need to add this code but the sample above has all set for you and should be clear

     /* initialize the external events
        -----------------------------------------------------------------*/
    $('#external-events div.external-event').each(function() {
    
        // create an Event Object (http://arshaw.com/fullcalendar/docs/event_data/Event_Object/)
        // it doesn't need to have a start or end
        var eventObject = {
            title: $.trim($(this).text()) // use the element's text as the event title
        };
    
        // store the Event Object in the DOM element so we can get to it later
        $(this).data('eventObject', eventObject);
    
        // make the event draggable using jQuery UI
        $(this).draggable({
            zIndex: 999,
            revert: true,      // will cause the event to go back to its
            revertDuration: 0  //  original position after the drag
        });
    
    });
    
    
    /* initialize the calendar
    -----------------------------------------------------------------*/
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have set the FlushMode property on an NHibernate session to FlushMode.Never, but when
I have set the itemRollOver and itemRollOut event listeners on a List component, but
I have set a list of items in a combobox, but when I debug
I have set up a macro for Smarty in Komodo Edit which adds a
I have set the title for navigation item on top of the screen. But
I have set of classes which inherit from a single super class: Super |
When creating the fullCalendar I can set firstHour and have it scroll to that
I have set of categories (the number of which changes according to specific state)
I have set up a WCF service that will accept both JSON and XML
I have set my FileMerge not to ignore any file. However, it ignores my

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.