In encountered a similar problem today and found a workaround. I don't
feel that it's a perfect solution, though.

On my page, I have three DIV elements to hold various items. After
each drop, I wanted a tally of what items were in each DIV. The only
problem was when I was dragging elements from one DIV to
another...when any event I had access to fired, I was still in the
middle of the drop and the count would be off.

Here's what I implemented, using the setTimeout() function in
javascript. Let's say I have a function "tallyFunction" that I wanted
to fire. In my droppable "drop" option, I specified the following:

$("#myObjectId").droppable({
     accept : '.myItem',
     drop : function(ev, ui) {
          //do stuff
          setTimeout("tallyFunction()",5);
     }
});

function tallyFunction() {
    //do stuff
}

***

The "5" in the setTimeout() function is in milliseconds. This really
only works if you can be sure your drop function will do its stuff by
the time the cleanup function fires and before the user does something
again. For me, this works at 1 millisecond, but it wouldn't be great
for a function that does a ton of processing.

Hope this gives at least one option or leads you to another
workaround.

-Keith

On Oct 14, 9:59 am, Steven <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm currently creating a drag and drop table, however, I'm coming
> across some issues with the stop and drop events...
>
> When I've "completed" a drop I am wanting to perform some clean-up
> operations, and then restripe the whole table which is the container
> for the draggables and droppables so the colour scheme stays in sync.
> However, I'm finding that if I use either the drop or stop event for a
> draggable ordroppableelement that the event hasn't actually
> "completed", so when I'm trying to perform a clean-up there's nothing
> to clean-up yet as everything hasn't completed.
>
> Is there another event I should know about which indicates when an
> actual drop has finished?If not, then how can I tell when everything
> has completed? I'm using the clone helper on the draggables so not
> sure if this will have an effect as the element is duplicating itself?
>
> Regards,
>
> Steven

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to