Freeze Column Header?

Help
2005-05-25
2013-04-29
  • Joe Goldwasser

    Joe Goldwasser - 2005-05-25

    Has anyone setup JPivot to be able to freeze the top row showing the measure names and the left side showing the level hierarchies?

    I looking to do this because reports quickly are hard to read as you have to scroll either vertically or horizontally.

    I figure one way would be to use DHTML and div tags, but I'm not sure how hard this would be to accomplish.  Any help is greatly appreciated...

    Joe

     
    • Edwin Fine

      Edwin Fine - 2005-12-28

      I also need to implement this. Did anyone find a good way to do it?

       
    • Manuel

      Manuel - 2008-11-06

      I have locked the header-row by using JQuery. This solution works on
      firefox and ie. It´s is easys to get the locked header-row in firefox. The
      table needs to consist of "thead" and "tbody". The tbody-element get a
      certain height. That´s all in firefox. The solution in IE it´s quiet
      difficult. I´ve found a solution which uses an css-expression. Check it
      out:

      <script type="text/javascript"> 
      jQuery(document).ready(
      function() {

          /* Allgemein: Aufteile in THead und TBody */
         
          jQuery("#table01").find("tbody").before("<thead></thead>");
          jQuery("#table01").find("tbody").find("tr").not(
              jQuery("#table01").find("tbody").find("tr").find("td").parent()).appendTo(jQuery("#table01").find("thead")
          );

          if(jQuery.browser.msie) {
              /* IE: Expression */
              jQuery(".JPivotContainer").css("overflow-x", "auto").css("overflow-y",
      "auto").css("width", "100%");
         
              if(jQuery("#table01").find("tbody")[0].offsetHeight > 420) {
                  jQuery(".JPivotContainer").css("height", "420px").css("position",
      "relative");
                 
                  jQuery("#table01").find("thead").css("background-color", "#EAEFFB");
                  jQuery("#table01").find("thead").find("tr").css("position",
      "relative");
             
                  jQuery("#table01").find("thead").find("tr").css("z-index", "100");
                  jQuery("#table01").find("thead").find("tr").each(function (i) {  
             
                      $(this).style.setExpression("top", "offsetParent.scrollTop");
                  })              
                    
              }
                 
              jQuery("#table01").css("margin-left", "-2px").css("margin-top",
      "-2px").css("margin-bottom", "15px");
         
          } else {
              /* Firefox: TBody bekommt feste Größe */
              if(jQuery("#table01").find("tbody")[0].offsetHeight > 420) {
                  jQuery("#table01").find("tbody").css("overflow-y",
      "scroll").css("overflow", "auto").css("height", "420px").css("overflow-x",
      "hidden");
                  jQuery("#table01").find("tbody").find("td").css("padding-right",
      "20px");
              }
          }

      });

      </script>

       
      • Ati Rosselet

        Ati Rosselet - 2008-11-06

        very nice, and it doesn't affect basic jpivot/mondrian operations since its just css...  gotta love jQuery!  I've used it in a couple of small projects, but never had the chance to really delve...
        I'm going to have to try this one out!

        Cheers
        Ati

         

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks