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

Re: How do I pass custom parameter to Drag&Drop handlers?

Expand Messages
  • coolaomnet
    Thanks for the reply. I fixed the problem, but I still think custom event provides a more elegant solution. This is the code I had: imgPanelDragger.onDrag =
    Message 1 of 3 , Dec 29, 2007
    • 0 Attachment
      Thanks for the reply. I fixed the problem, but I still think custom
      event provides a more elegant solution.

      This is the code I had:

      imgPanelDragger.onDrag = function(e){
      this.showImgPanel.hide();
      };

      which gives me this error in firefox: this.showImgPanel has no
      properties. I just realized that onDrag is called from a different
      context, thus "this" in the onDrag handler is not the same "this" as
      in the current code block. I removed "this" keyword, problem solved.

      By the way, I am facing the same problem with YAHOO.util.KeyListener.
      If you can add keyDown/keyUp events that I can subscribe to, it'll be
      great.

      --- In ydn-javascript@yahoogroups.com, dav.glass@... wrote:
      >
      > coolaomnet --
      >
      > Currently there are no CustomEvents in DragDrop (I'm working on
      those for the 2.5) release coming soon :)
      >
      > Can you post a code example of what you are trying to do, maybe I
      can give you a hand?
      >
      > Dav
      >
      > Dav Glass
      > dav.glass@...
      > blog.davglass.com
      >
      > + Windows: n. - The most successful computer virus, ever. +
      > + A computer without a Microsoft operating system is like a dog
      > without bricks tied to its head +
      > + A Microsoft Certified Systems Engineer is to computing what a
      > McDonalds Certified Food Specialist is to fine cuisine +
      >
      > ----- Original Message ----
      > From: coolaomnet <looks.like.it@...>
      > To: ydn-javascript@yahoogroups.com
      > Sent: Friday, December 28, 2007 1:54:26 PM
      > Subject: [ydn-javascript] How do I pass custom parameter to
      Drag&Drop handlers?
      >
      >
      > I have the following code
      >
      > var dragger = new YAHOO.util.DD('elem');
      > dragger.onDrag = function(e){
      > //do something
      > };
      >
      > and I want to pass extra parameter to the onDrag handler. I couldn't
      > find any custom events such as onDragEvent I can subscribe to. I am
      > stuck.
      >
      > Any hint would be appreciated.
      >
      >
      >
      >
      > Yahoo! Groups Links
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.