Cannot "freeze" left column

Cannot "freeze" left column

jbeard03jbeard03 Posts: 13Questions: 0Answers: 0
edited September 2010 in FixedHeader
First, let me say great software. I have implemented DataTables and the FixedHeader plugin - http://www.memphisyouthsoccer.com/availtest/reflog.php
but I can not get the left column to "freeze". As you can see the fixed header is working as are other elements of DataTables.

I have included the "left": true code but no results. I am using PHP to generate the table (using data from a csv file).

Any ideas?

Replies

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin
    It looks like there is a Javascript error on the page which is causing the problem. In fact, more specifically, the error is caused by the last two columns in your table. DataTables shows this on the console:

    "DataTables warning (table id = 'log'): Unexpected number of TD elements. Expected 192 and got 195. DataTables does not support rowspan / colspan in the table body, and there must be one cell for each row/column combination."

    As it says, there needs to be a unique header for each column - which there isn't at the moment. I suspect when that is changed it should just start working.

    Allan
  • jbeard03jbeard03 Posts: 13Questions: 0Answers: 0
    Sorry, I forgot to mention that I had tried that - I changed the code to demonstrate (now there are unique headers).

    I found a thread that discussed a bug that you fixed that caused FixedHeader to want a footer. I uncommented the footer and made sure they were unique - now the first column is trying to freeze but for some reason it skips the first row and uses the first cell of the footer (heights are off as well).

    http://www.memphisyouthsoccer.com/availtest/reflog.php
  • jbeard03jbeard03 Posts: 13Questions: 0Answers: 0
    I seem to having it "working" now. I had to have a footer and I had to set the height in the css file.
  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin
    Here is a checked in copy of FixedHeader fixed for the no footer situation: http://github.com/DataTables/FixedHeader/blob/master/js/FixedHeader.js

    Diff: http://github.com/DataTables/FixedHeader/commit/558b3a7370feae5f08b665a44ef84791654bcbb5

    Allan
  • jbeard03jbeard03 Posts: 13Questions: 0Answers: 0
    Sorry I wasn't clearer - when I found the thread discussing the footer problem I downloaded the referenced fix above but it didn't fix the footer problem for me.
  • jbeard03jbeard03 Posts: 13Questions: 0Answers: 0
    I have decided that I like having a footer, but FYI the code still requires that I have one in order to "freeze" the left column.
  • jbeard03jbeard03 Posts: 13Questions: 0Answers: 0
    My other problem (with TableTools) is resolved - I forgot to add a to my page. I mentioned that I thought that might have caused me to need a footer to "freeze" the left column - but I just tested by commenting the footer with everything working and the left column was no longer frozen (TableTools did still work though).

    Thank you again for everything.
This discussion has been closed.