Ticket #6285 (assigned enhancement)

Opened 5 months ago

Last modified 5 months ago

low level drag and drop as easy as scriptaculous

Reported by: harobed Owned by: elazutkin
Priority: normal Milestone: 1.2
Component: DnD Version: 1.0
Severity: normal Keywords:
Cc:

Description (last modified by elazutkin) (diff)

Hi,

sometimes dojo.dnd mechanism is overkill for my need and I would like use something like scriptaculous drag and drop mechanism.

In Scriptaculous, to perform drag and drop you need two things :

  • Draggable objet
  • Droppable.add method

Example :

var drag = new Draggable(

'id_of_draggable_element', {

revert: true, ghosting: true, onEnd: function() {

console.log("draggable end");

}

}

);

Droppable.add(

'id_of_droppable_element', {

onHover: function(draggable_element, droppable_element) {

console.log(draggable_element); console.log(droppable_element);

}, onDrop: function(draggable_element, droppable_element, event)

{

console.log(draggable_element); console.log(droppable_element); console.log(event);

}

}

);

I think this is lower level than dojo.dnd mechanism.

Few month ago, I've spoke about it in mailing list : http://thread.gmane.org/gmane.comp.web.dojo.user/31296/focus=31297

I've suggested to develop this feature. I do it. See my patch.

Note : this patch need dojo.within function proposed in http://trac.dojotoolkit.org/ticket/6284

Soon, I'll write small documentation about this new feature.

Regards, Stephane

Attachments

low_level_draggable_droppable_like_scriptaculous.patch (27.3 kB) - added by harobed 5 months ago.
Patch : Low level draggable droppable like scriptaculous

Change History

Changed 5 months ago by harobed

Patch : Low level draggable droppable like scriptaculous

Changed 5 months ago by harobed

  • description modified (diff)

Changed 5 months ago by bill

  • milestone set to 1.2

I doubt that we want to add an alternate DnD mechanism into dojo core, or even dojox, but will leave to Eugene. Setting milestone to 1.2 so it doesn't show up in 1.1 queue.

Changed 5 months ago by elazutkin

  • status changed from new to assigned
  • description modified (diff)
Note: See TracTickets for help on using tickets.