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

TaskNode uncheck() not working

Expand Messages
  • popcorn_029
    Hi all, I need the functionality of being able to uncheck all nodes in the tree at once. I have written a javascript function for this but it is not working..
    Message 1 of 4 , Jul 25, 2006
    • 0 Attachment
      Hi all,

      I need the functionality of being able to uncheck all nodes in the
      tree at once. I have written a javascript function for this but it
      is not working.. can anyone help?

      The code snippet is as follows:
      for(var i = 1; i <= tree.nodeCount; ++i)
      {
      tree.getNodeByIndex(i).uncheck();
      }

      I also tried this:
      for(var i = 1; i <= tree.nodeCount; ++i)
      {
      tree.getNodeByIndex(i).setCheckState(0);
      }

      None of the above are working. Any idea what I am missing?

      Thanks!
    • Adam Moore
      ... function uncheckAll() { var topNodes = tree.getRoot().children; for(var i = 0; i
      Message 2 of 4 , Jul 25, 2006
      • 0 Attachment
        On Tue, Jul 25, 2006 at 11:54:46AM -0000, popcorn_029 wrote:
        > Hi all,
        >
        > I need the functionality of being able to uncheck all nodes in the
        > tree at once. I have written a javascript function for this but it
        > is not working.. can anyone help?


        function uncheckAll() {
        var topNodes = tree.getRoot().children;
        for(var i = 0; i <= topNodes.length; ++i) {
        topNodes[i].uncheck();
        }
        }

        -Adam
      • popcorn_029
        ... Shouldn t that be for(var i = 0; i
        Message 3 of 4 , Jul 25, 2006
        • 0 Attachment
          --- In ydn-javascript@yahoogroups.com, Adam Moore <adamoore@...> wrote:

          > for(var i = 0; i <= topNodes.length; ++i) {

          Shouldn't that be for(var i = 0; i<topNodes.length; i++)? Do arrays
          work differently in javascript?

          Thanks.
        • Adam Moore
          ... Yes, my mistake. -Adam
          Message 4 of 4 , Jul 25, 2006
          • 0 Attachment
            On Wed, Jul 26, 2006 at 04:30:25AM -0000, popcorn_029 wrote:
            > --- In ydn-javascript@yahoogroups.com, Adam Moore <adamoore@...> wrote:
            >
            > > for(var i = 0; i <= topNodes.length; ++i) {
            >
            > Shouldn't that be for(var i = 0; i<topNodes.length; i++)? Do arrays
            > work differently in javascript?

            Yes, my mistake.

            -Adam
          Your message has been successfully submitted and would be delivered to recipients shortly.