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

Bug in TaskNode.js for TreeView UI lib

Expand Messages
  • Sai Nagboth
    There is a small bug in taskNode.js example given by yahoo in their TreeView UI library. When you use the 4th parameter checked while initializing the tasknode
    Message 1 of 1 , Feb 27, 2006

      There is a small bug in taskNode.js example given by yahoo in their TreeView UI library.

      When you use the 4th parameter checked while initializing the tasknode and set it to true, then you will see some unusual behaviour.  E.g., even if all child nodes of a node are not checked it shows the parent checked and so on...

      The problem is with the statement in the function below highlighted in red.

      YAHOO.widget.TaskNode = function(oData, oParent, expanded, checked) {
          this.logger = new ygLogger("TaskNode");

       if (oParent) {
        this.init(oData, oParent, expanded);
        this.setUpLabel(oData);
        this.checked = checked;
       }
      };

      the fix is very simple, in above code replace the line highlighted in red as below...

      YAHOO.widget.TaskNode = function(oData, oParent, expanded, checked) {
          this.logger = new ygLogger("TaskNode");

       if (oParent) {
        this.init(oData, oParent, expanded);
        this.setUpLabel(oData);
       
      if(checked) this.check();
       }
      };

      Yahoo.. please fix this in your next releases.

      Sai

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