hi there!

is there a way (plugin or something) to combine sortables with
droppables? my setup is as follows: a container-div with several
items , declared as sortables. as soon as i drag an item, this is
declared as drag.move element and the others as droppables. but it
doesnt work. i didnt find function in the framework for sorting and
grouping entries by dragging them on each other, so i hope for help.
code:

html:

<div id="tasks_wrapper">
    <div class="task"><h1>1</h1></div>
    <div class="task"><h1>2</h1></div>
    <div class="task"><h1>3</h1></div>
    <div class="task"><h1>4</h1></div>
    <div class="task"><h1>5</h1></div>
</div>

js:

var taskSortables = new Sortables('#tasks_wrapper', {
                        clone: true,
                        revert: true,
                        snap: 10,
                        onStart : function(element, clone) {

                                var myDrag = new Drag.Move(element, {

                                        droppables: '.task',

                                        onDrop: function(element, droppable, 
event){
                                                if (!droppable) 
console.log(element, ' dropped on nothing');
                                                else console.log(element, 
'dropped on', droppable, 'event',
event);
                                        },

                                        onEnter: function(element, droppable){
                                                console.log(element, 'entered', 
droppable);
                                        },

                                        onLeave: function(element, droppable){
                                                console.log(element, 'left', 
droppable);
                                        }

                                });

                        },
                        onComplete : function(element, clone) {
                                //
                        }

                });

Reply via email to