This project is archived and is in readonly mode.

#307 ✓invalid
Jillis ter Hove

Dynamic droppables are not found by older Draggable

Reported by Jillis ter Hove | August 8th, 2008 @ 10:30 AM | in 2.0 (closed)

Since Drag.Move doesn't recompute the droppables list in the checkDroppables function it is possible for "newer" droppables to be ignored.

To see that this is a problem consider the following case:

2 trees, that allow their nodes to be dragged and then dropped onto the other tree causing to node to be copied into the other tree. When a new node is inserted into the tree and given the classname that the drag.move instance is checking for then these new nodes will not be registered as droppables.

This "problem" can be fixed by adding, as the first line of the checkDroppables function, the following code: this.droppables = $$(this.options.droppables); This forces the droppables list to be recomputed and the new nodes to be found as valid droppables.

Comments and changes to this ticket

  • Tom Occhino

    Tom Occhino August 24th, 2008 @ 04:00 AM

    • State changed from “new” to “invalid”
    • Assigned user changed from “Valerio” to “Tom Occhino”

    Droppables are not added automatically by design. They should be updated manually for performance reasons.

    The Sortables class actually does this already internally if you'd like to see an idea of how to do it in your own implementations.

  • solchitos

    solchitos July 19th, 2009 @ 01:07 AM

    • Tag changed from defect, enhancement, minor, patch to defect, enhancement, patch

    I resolve it...

    en (if you need add droppables after ajax load, onStart drag capture new droppables..)
    es (si despues de una carga ajax necesitas nuevos huecos para 'drop', en el evento onStart del drag captura todos los huecos de nuevo)

    example...

    droppables: '.hueco_archivo',
    
                    onStart: function(element,droppable){
                    this.droppables = $$('.hueco_archivo');
                },
    

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket

Pages