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

YUI TreeView and custom nodes

Expand Messages
  • jss_cw
    This is a question closely related to the example provided by Yahoo! with creating custom nodes. (Example provided:
    Message 1 of 3 , Jun 2, 2009
    • 0 Attachment
      This is a question closely related to the example provided by Yahoo! with creating custom nodes. (Example provided: http://developer.yahoo.com/yui/examples/treeview/tasklist.html)

      I noticed that when using YUI TreeView, we are able to pass a JSON object to the TreeView constructor as the second parameter, granted the JSON object included headings for TextNodes or HTMLNodes. However, when changing the labels within the JSON object to use my custom created node (which extends HTMLNode) I don't seem to be able to pass the JSON object the same way.

      I have tested it, so when creating the nodes individually:
      i.e. var tmpNode = new YAHOO.widget.XXXXNode( "html code",
      tree.getRoot(), false );
      The custom node used with the code above works just fine.

      Is there anything I must do in the Custom Node's .js file to allow for passing an object? or is the TreeView constructor strictly limited to the nodes that are already specified with the YUI.

      Thanks,
      jss
    • Satyam
      As of 2.7.0, the TreeView control already supports the functionality of the TaskNode example in all of its nodes. It is referred to as node highlighting and
      Message 2 of 3 , Jun 3, 2009
      • 0 Attachment
        As of 2.7.0, the TreeView control already supports the functionality of
        the TaskNode example in all of its nodes. It is referred to as node
        highlighting and via CSS styles, that highlight can be presented as
        checkboxes via suitable background images. Unfortunately, the examples
        for this functionality didn't get into the YUI site so I have placed
        them in:

        http://satyam.com.ar/yui/2.7.0/tasklist.html

        You will notice that it loads its own copy of the TreeView library. The
        released version had some bugs and the stylesheet wasn't deployed
        correctly so you will be better off downloading a copy of the treeview
        files from GitHub, in the /build folder, both the JavaScript files as
        well as all the files in the /build/treeview/assets/skins/sam. The
        actual URL changes depending on the most recent commit so you'll have to
        travel the path yourself starting from:

        http://github.com/yui/yui2/tree/master

        For you, this means that you can use a plain TextNode since the
        checkboxes are now available on all node types, you don't need to use
        any specific custom node type to have this functionality.

        Satyam


        jss_cw escribió:
        > This is a question closely related to the example provided by Yahoo! with creating custom nodes. (Example provided: http://developer.yahoo.com/yui/examples/treeview/tasklist.html)
        >
        > I noticed that when using YUI TreeView, we are able to pass a JSON object to the TreeView constructor as the second parameter, granted the JSON object included headings for TextNodes or HTMLNodes. However, when changing the labels within the JSON object to use my custom created node (which extends HTMLNode) I don't seem to be able to pass the JSON object the same way.
        >
        > I have tested it, so when creating the nodes individually:
        > i.e. var tmpNode = new YAHOO.widget.XXXXNode( "html code",
        > tree.getRoot(), false );
        > The custom node used with the code above works just fine.
        >
        > Is there anything I must do in the Custom Node's .js file to allow for passing an object? or is the TreeView constructor strictly limited to the nodes that are already specified with the YUI.
        >
        > Thanks,
        > jss
        >
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
        > ------------------------------------------------------------------------
        >
        >
        > No virus found in this incoming message.
        > Checked by AVG - www.avg.com
        > Version: 8.5.339 / Virus Database: 270.12.50/2150 - Release Date: 06/02/09 06:47:00
        >
        >
      • Jaime Soo See
        Hi Satyam, Thank you very much for your reply and the links, I ll begin looking through what you mentioned today and hopefully it ll all come together :).
        Message 3 of 3 , Jun 3, 2009
        • 0 Attachment
          Hi Satyam,

          Thank you very much for your reply and the links, I'll begin looking through what you mentioned today and hopefully it'll all come together :).

          Thanks!
          jss

          --- On Wed, 6/3/09, Satyam <satyam@...> wrote:

          From: Satyam <satyam@...>
          Subject: Re: [ydn-javascript] YUI TreeView and custom nodes
          To: ydn-javascript@yahoogroups.com
          Received: Wednesday, June 3, 2009, 5:03 AM

          As of 2.7.0, the TreeView control already supports the functionality of
          the TaskNode example in all of its nodes. It is referred to as node
          highlighting and via CSS styles, that highlight can be presented as
          checkboxes via suitable background images. Unfortunately, the examples
          for this functionality didn't get into the YUI site so I have placed
          them in:

          http://satyam. com.ar/yui/ 2.7.0/tasklist. html

          You will notice that it loads its own copy of the TreeView library. The
          released version had some bugs and the stylesheet wasn't deployed
          correctly so you will be better off downloading a copy of the treeview
          files from GitHub, in the /build folder, both the JavaScript files as
          well as all the files in the /build/treeview/ assets/skins/ sam. The
          actual URL changes depending on the most recent commit so you'll have to
          travel the path yourself starting from:

          http://github. com/yui/yui2/ tree/master

          For you, this means that you can use a plain TextNode since the
          checkboxes are now available on all node types, you don't need to use
          any specific custom node type to have this functionality.

          Satyam

          jss_cw escribió:
          > This is a question closely related to the example provided by Yahoo! with creating custom nodes. (Example provided: http://developer. yahoo.com/ yui/examples/ treeview/ tasklist. html)
          >
          > I noticed that when using YUI TreeView, we are able to pass a JSON object to the TreeView constructor as the second parameter, granted the JSON object included headings for TextNodes or HTMLNodes. However, when changing the labels within the JSON object to use my custom created node (which extends HTMLNode) I don't seem to be able to pass the JSON object the same way.
          >
          > I have tested it, so when creating the nodes individually:
          > i.e. var tmpNode = new YAHOO.widget. XXXXNode( "html code",
          > tree.getRoot( ), false );
          > The custom node used with the code above works just fine.
          >
          > Is there anything I must do in the Custom Node's .js file to allow for passing an object? or is the TreeView constructor strictly limited to the nodes that are already specified with the YUI.
          >
          > Thanks,
          > jss
          >
          >
          >
          > ------------ --------- --------- ------
          >
          > Yahoo! Groups Links
          >
          >
          >
          > ------------ --------- --------- --------- --------- --------- -
          >
          >
          > No virus found in this incoming message.
          > Checked by AVG - www.avg.com
          > Version: 8.5.339 / Virus Database: 270.12.50/2150 - Release Date: 06/02/09 06:47:00
          >
          >



          The new Internet Explorer® 8 - Faster, safer, easier. Optimized for Yahoo! Get it Now for Free!
        Your message has been successfully submitted and would be delivered to recipients shortly.