0

I have a portlet view jsp that I am trying to fix the left two columns along with the headers using dataTables and the FixedColumns plugin for a pivot table.

I get the header row to fix and to be able to scroll the Y-axis, but I am unable to Fix the two left columns in place as the code suggests.

 <script  type="text/javascript">
  var pTable ;
 $(document).ready( function () {
    pTable = $('#scheduleTable').dataTable( {
    "sDom": "<'row-fluid'r><'row-fluid't><'row-fluid'<'span6'i><'span6'p>>", 

    "sScrollY": 200,
    "sScrollX": "100%",
    "sScrollXInner": "100%",
    "bScrollCollapse": false,
    "fnInitComplete": function () {
       var fCols =  new FixedColumns( pTable , {
                "iLeftColumns":2,
                "sHeightMatch" : "auto",
                "iRightColumns": 0
                }
        );
      }
});

} );

</script>

I can see the FixColumns library via Firebug in Firefox but I cannot see how or if it is applied to the dataTable. It seems like the FixedColumns code is being ignored. Any thoughts on how to better debug this or to code this?

Thank you in advance.

1 Answer 1

1

@iowatiger08

have you tried this way:

var pTable ;
$(document).ready( function () {
    pTable = $('#scheduleTable').dataTable( {
        "sDom": "<'row-fluid'r><'row-fluid't><'row-fluid'<'span6'i><'span6'p>>", 

        "sScrollY": 200,
        "sScrollX": "100%",
        "sScrollXInner": "100%",
        "bScrollCollapse": false
    });
    new FixedColumns( pTable , {
        "iLeftColumns":2,
        "sHeightMatch" : "auto",
        "iRightColumns": 0
    });

});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.