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

12387Re: [ydn-javascript] Omitting tree expand when code label clicked in TreeView

Expand Messages
  • Eric Miraglia
    Apr 19, 2007

      Two quick thoughts here:

      1.  Working with TreeView on its current terms, you could get very close to what you want (maybe all the way there) by returning false on your labelclick handler and the using css to style away the linkiness of the <a> tag.  Adam Moore, TreeView's author, notes that this relies on the DOM0 behavior wrt returning false, and we haven't tested this across the A-grade browsers.  But I ran it through several just now with good results.  Caveat emptor, of course, but it may be something to try.

      2.  What you are really asking for, I think, is more control over how TextNodes are created/structured (and in your  subsequent email you're asking for the API for labelclick be inclusive of TaskNode).  The best way to get these requests into our process is to add them as feature requests in SourceForge.


      Eric Miraglia
      Yahoo! User Interface Library

      On Apr 19, 2007, at 12:25 PM, Alessandro Vernet wrote:


      I am following up on this thread from February. The solution you suggest
      works, but the downside is that it requires to re-implement the method
      getNodeHtml(). This means doing a large copy-paste of TextNode.getNodeHtml()
      and just removing the line that sets the href. Since the code generated
      there is tied to some internal code of the tree, there is a chance that this
      method will need to be modified when upgrading to a new version of YUI.

      So I would really prefer to have a way to tell the existing TextNode not to
      generate an href.

      For some background, this happens when you do a tree.subscribe("labelClick",
      ...) to handle clicks on labels. You don't want to go to a URL, and you
      don't want the default behavior (collapse/uncollapse).


      Eric Miraglia wrote:
      > suchanek_tomasz,
      > The best solution for you here is to use HTMLNodes rather than the
      > TextNodes. See the TreeView documentation for more on how to use
      > HTMLNodes.
      > Regards,
      > Eric
      > ______________________________________________
      > Eric Miraglia
      > Yahoo! User Interface Library
      > On Feb 1, 2007, at 7:52 AM, suchanek_tomasz wrote:
      >> As written in topic. How can I omit expanding tree when labal is
      >> clicked? I want to expand/collapse nodes only when icon + - is
      >> clicked.

      View this message in context: http://www.nabble.com/Omitting-tree-expand-when-code-label-clicked-in-TreeView-tf3155643.html#a10085209
      Sent from the ydn-javascript mailing list archive at Nabble.com.

    • Show all 7 messages in this topic