Loading ...
Sorry, an error occurred while loading the content.

DD Library -> Event onDragDrop source id !!

Expand Messages
  • ivo.benedito
    function dragDropInit() { var dd = new YAHOO.util.DDProxy( div1 ); var dd2 = new YAHOO.util.DDTarget( div2 ); dd.onDragDrop = function(e, id) { alert( target
    Message 1 of 2 , Apr 5, 2006
    • 0 Attachment
      function dragDropInit() {
      var dd = new YAHOO.util.DDProxy('div1');
      var dd2 = new YAHOO.util.DDTarget('div2');

      dd.onDragDrop = function(e, id) {
      alert("target id = " + id + " || source id = " + e.source.id);
      };
      }

      YAHOO.util.Event.addListener(window, 'load', dragDropInit);


      Hi, im trying to do something like this, i need to get the id from the
      element i'm dragging and the target element where i drop the drag elem.
      The target id is received by parameter on the event handler, but the
      source id isn't :| !! Is it possible to get the source id from the
      onMouseUp source event received by parameter ?

      Tks in advance,
      Ivo
    • Adam Moore
      ... Hi Ivo, the dd instance being dragged is the scope: dd.onDragDrop = function(e, id) { alert( target id = + id + || source id = + this.id); }; -Adam
      Message 2 of 2 , Apr 5, 2006
      • 0 Attachment
        On Wed, Apr 05, 2006 at 11:00:01AM -0000, ivo.benedito wrote:
        >
        > function dragDropInit() {
        > var dd = new YAHOO.util.DDProxy('div1');
        > var dd2 = new YAHOO.util.DDTarget('div2');
        >
        > dd.onDragDrop = function(e, id) {
        > alert("target id = " + id + " || source id = " + e.source.id);
        > };
        > }
        >
        > YAHOO.util.Event.addListener(window, 'load', dragDropInit);
        >
        >
        > Hi, im trying to do something like this, i need to get the id from the
        > element i'm dragging and the target element where i drop the drag elem.
        > The target id is received by parameter on the event handler, but the
        > source id isn't :| !! Is it possible to get the source id from the
        > onMouseUp source event received by parameter ?

        Hi Ivo, the dd instance being dragged is the scope:

        dd.onDragDrop = function(e, id) {
        alert("target id = " + id + " || source id = " + this.id);
        };


        -Adam
      Your message has been successfully submitted and would be delivered to recipients shortly.