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

Re: [ydn-javascript] ContextMenu and TreeView

Expand Messages
  • Nige White
    I agree this is necessary functionality if you want to hang context menus on tree nodes, and I have to do exactly the same hack. I ve submitted an enhancement
    Message 1 of 2 , Aug 31, 2006
    • 0 Attachment
      I agree this is necessary functionality if you want to hang context
      menus on tree nodes, and I have to do exactly the same hack. I've
      submitted an enhancement request:
      http://sourceforge.net/tracker/index.php?func=detail&aid=1490987&group_id=165715&atid=836479

      alex.pooley wrote:

      > Yo!
      >
      > I have a TreeView, and a ContextMenu triggered by the TreeView. When a
      > click occurs in the menu, I want to access the TextNode that is part
      > of the TreeView. The problem is that the contextEventTarget available
      > in the click handler is an Anchor DOM node that forms part of the
      > TextNode's HTML. Is there an easy way to grab the TextNode via a
      > ContextMenu event?
      >
      > I was able to work around the issue by parsing the ID of the Anchor
      > element for the digit at the end. Then I could perform a
      > TreeView.getNodeByIndex using the parsed digit to return the node. I
      > consider this a hack and am hoping for a better solution.
      >
      > Anyone? :)
      >
      > FYI. The code I'm using to grab the TextNode from the HTML Node is this:
      >
      > var labelEl = this.parent.contextEventTarget;
      > var index = labelEl.id.slice('ygtvlabelel'.length);
      > var node = tree.getNodeByIndex(index);
      >
      >
      > _____________________________________________________________________
      > This message has been checked for all known viruses. Virus scanning
      > powered by Messagelabs http://www.messagelabs.com For more information
      > e-mail : hostmaster@...



      _____________________________________________________________________
      This message has been checked for all known viruses. Virus scanning
      powered by Messagelabs http://www.messagelabs.com For more information
      e-mail : hostmaster@...
    Your message has been successfully submitted and would be delivered to recipients shortly.