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

[BUG]Ver 2.2.2 Treeview in IE 6 !

Expand Messages
  • amuclan
    when you create a treeview , if the leaf node is expanded , then a blank line will apear following the leaf node in IE 6 ! BUT IE 7 has not this bug. only
    Message 1 of 4 , Jun 30, 2007
    • 0 Attachment
      when you create a treeview , if the leaf node is expanded , then a blank line will apear following the leaf node in IE 6 !

      BUT IE 7 has not this bug.

      only modify the yui default treeview example , we will see the bug demo:

      <script type="text/javascript">
      //<![CDATA[

      var tree;
      (function() {

          function treeInit() {
              buildRandomTextNodeTree();
          }
          
          function buildRandomTextNodeTree() {
              tree = new YAHOO.widget.TreeView("treeDiv1");

              for (var i = 0; i < Math.floor((Math.random()*4) + 3); i++) {
                  var tmpNode = new YAHOO.widget.TextNode("label-" + i, tree.getRoot(), true);
                  // tmpNode.collapse();
                  // tmpNode.expand();
                  // buildRandomTextBranch(tmpNode);
                  buildLargeBranch(tmpNode);
              }

             // Expand and collapse happen prior to the actual expand/collapse,
             // and can be used to cancel the operation
             tree.subscribe("expand", function(node) {
                    //alert(node.index + " was expanded");
                    // return false; // return false to cancel the expand
                 });

             tree.subscribe("collapse", function(node) {
                    //alert(node.index + " was collapsed");
                 });

             // Trees with TextNodes will fire an event for when the label is clicked:
             tree.subscribe("labelClick", function(node) {
                    //alert(node.index + " label was clicked");
                 });


              tree.draw();
          }

          function buildLargeBranch(node) {
              if (node.depth < 10) {
                  YAHOO.log("buildRandomTextBranch: " + node.index);
                  for ( var i = 0; i < 10; i++ ) {
                      new YAHOO.widget.TextNode(node.label + "-" + i, node, true);
                  }
              }
          }

          function buildRandomTextBranch(node) {
              if (node.depth < 10) {
                  YAHOO.log("buildRandomTextBranch: " + node.index);
                  for ( var i = 0; i < Math.floor(Math.random() * 4) ; i++ ) {
                      var tmpNode = new YAHOO.widget.TextNode(node.label + "-" + i, node, false);
                      buildRandomTextBranch(tmpNode);
                  }
              }
          }

          YAHOO.util.Event.addListener(window, "load", treeInit);

      })();

      //]]>
      </script>
    • Eric Miraglia
      amuclan, Thanks for sharing this. Note that the correct place to file bug reports is in SourceForge -- that s the best way for us to track the information and
      Message 2 of 4 , Jun 30, 2007
      • 0 Attachment
        amuclan,

        Thanks for sharing this.

        Note that the correct place to file bug reports is in SourceForge -- that's the best way for us to track the information and respond to it while keeping the bug's reporter in the loop.

        Please read through our bug reporting guidelines and be sure to get this into SourceForge for review.

        Regards,
        Eric



        ______________________________________________
        Eric Miraglia
        Yahoo! User Interface Library



        On Jun 30, 2007, at 5:25 AM, amuclan wrote:

        when you create a treeview , if the leaf node is expanded , then a blank line will apear following the leaf node in IE 6 !

        BUT IE 7 has not this bug.

        only modify the yui default treeview example , we will see the bug demo:

        <script type="text/javascript">
        //<![CDATA[

        var tree;
        (function() {

            function treeInit() {
                buildRandomTextNodeTree();
            }
            
            function buildRandomTextNodeTree() {
                tree = new YAHOO.widget.TreeView("treeDiv1");

                for (var i = 0; i < Math.floor((Math.random()*4) + 3); i++) {
                    var tmpNode = new YAHOO.widget.TextNode("label-" + i, tree.getRoot(),true);
                    // tmpNode.collapse();
                    // tmpNode.expand();
                    // buildRandomTextBranch(tmpNode);
                    buildLargeBranch(tmpNode);
                }

               // Expand and collapse happen prior to the actual expand/collapse,
               // and can be used to cancel the operation
               tree.subscribe("expand", function(node) {
                      //alert(node.index + " was expanded");
                      // ! return false; // return false to cancel the expand
          &nbs p;        });

               tree.subscribe("collapse", function(node) {
                      //alert(node.index + " was collapsed");
                   });

               // Trees with TextNodes will fire an event for when the label is clicked:
               tree.subscribe("labelClick", function(node) {
                      //alert(node.index + " label was clicked");
                   });


                tree.draw();
            }

            function buildLargeBranch(node) {
                if (node.depth < 10) {
        &nb! sp;           YAHOO.log("buildRandomTextBranch: " + node.index);
                    for ( var i = 0; i < 10; i++ ) {
                        new YAHOO.widget.TextNode(node.label + "-" + i, node, true);
                    }
                }
            }

            function buildRandomTextBranch(node) {
                if (node.depth < 10) {
                    YAHOO.log("buildRandomTextBranch: " + node.index);
                    for ( var i = 0; i < Math.floor(Math.random() * 4) ; i++ ) {           &nb sp;    var tmpNode = new YAHOO.widget.TextNode(node.label + "-" + i, node, false);
                        buildRandomTextBranch(tmpNode);
                    }
                }
            }

            YAHOO.util.Event.addListener(window, "load", treeInit);

        })();

        //]]>
        </script>


      • amuclan
        Thank you :) You have good manners. I am a fresh man here . I will accept your advice. And I share a temporary solution here for the bug: var tree = new
        Message 3 of 4 , Jul 2, 2007
        • 0 Attachment
          Thank you :)
          You have good manners. I am a fresh man here .
          I will accept your advice.

          And I share a temporary solution here for the bug:

                  var tree = new YAHOO.widget.TreeView("treediv");
                  ...........
              tree.draw();
             
              if(navigator.appVersion.indexOf("MSIE")>0 && navigator.appVersion.indexOf("MSIE 7.0")<0){
              //fix all IE except IE7
                  $('treediv').getElementsByClassName('ygtvchildren').each(function(v){
                          if(v.innerHTML == ""){
                          v.setStyle({display:'none'});
                      }
                  });
              }



          ps: I use prototype framework(www.prototypejs.org) in code.


          --- In ydn-javascript@yahoogroups.com, Eric Miraglia <miraglia@...> wrote:
          >
          > amuclan,
          >
          > Thanks for sharing this.
          >
          > Note that the correct place to file bug reports is in SourceForge -- 
          > that's the best way for us to track the information and respond to it 
          > while keeping the bug's reporter in the loop.
          >
          > Please read through our bug reporting guidelines and be sure to get 
          > this into SourceForge for review.
          >
          > Regards,
          > Eric
          >
          >
          >
          > ______________________________________________
          > Eric Miraglia
          > Yahoo! User Interface Library
          >
          >
          >
          > On Jun 30, 2007, at 5:25 AM, amuclan wrote:

        • amuclan
          I filed the bug at: http://sourceforge.net/tracker/index.php?func=detail&aid=1746547&group_id=165715&atid=836476
          Message 4 of 4 , Jul 2, 2007
          • 0 Attachment
          Your message has been successfully submitted and would be delivered to recipients shortly.