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

Tree View having problems showing children-count for a node!!

Expand Messages
  • kamran_zeropointian
    Hi all! I am using YUI s Tree View and want to get the number of children a node has.For that matter, I have created a tree with every node having at least one
    Message 1 of 2 , Aug 31, 2009
    • 0 Attachment
      Hi all!

      I am using YUI's Tree View and want to get the number of children a node has.For that matter, I have created a tree with every node having at least one child.When I get the children-count for any node by using selectedNode.children.length method, it gives me zero but only when the tree is in the constricted view, however, for the collapsed tree it works fine.Is it a bug or there's some problem with my approach.Also please suggest if there can be some workaround.

      Thanks in advance,
      Kamran.
    • Satyam
      Using children.length should be fine. There is getNodeCount but that counts all the descendants, not just the children but grandchildren and later
      Message 2 of 2 , Sep 1, 2009
      • 0 Attachment
        Using children.length should be fine. There is getNodeCount but that
        counts all the descendants, not just the children but grandchildren and
        later generations. It uses children.length as well at each level. I
        can only think that whatever way you are using to reference what you
        call "selectedNode" in your message below, might have become invalid
        (like turning null or undefined) and thus having no children at all. If
        that is not the case, could you provide us with some working code that
        shows the behaviour?

        Satyam


        kamran_zeropointian escribió:
        > Hi all!
        >
        > I am using YUI's Tree View and want to get the number of children a node has.For that matter, I have created a tree with every node having at least one child.When I get the children-count for any node by using selectedNode.children.length method, it gives me zero but only when the tree is in the constricted view, however, for the collapsed tree it works fine.Is it a bug or there's some problem with my approach.Also please suggest if there can be some workaround.
        >
        > Thanks in advance,
        > Kamran.
        >
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
        > ------------------------------------------------------------------------
        >
        >
        > No virus found in this incoming message.
        > Checked by AVG - www.avg.com
        > Version: 8.5.409 / Virus Database: 270.13.72/2337 - Release Date: 08/31/09 05:50:00
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.