Does TableTools work with FixedHeader

Does TableTools work with FixedHeader

jbeard03jbeard03 Posts: 13Questions: 0Answers: 0
edited September 2010 in TableTools
Can one use TableTools with FixedHeader? If so, what is the initialisation code?

I can not. I can get either to work but not at the same time.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Certainly should work. It should just be a case of including the 'T' option in the sDom for TableTools, and then the FixedHeader initialisation. What happens at the moment with the code you've got?

    Allan
  • jbeard03jbeard03 Posts: 13Questions: 0Answers: 0
    When I add the line [code]"sDom": 'T<"clear">lfrtip'[/code] the search box goes away and the SWF is not displayed. I set the init variable and the SWF is in the root with the php file. (I also added the script calls to TableTools.js and ZeroClipboard.js) Current code has the "sDom" line commented.
    http://www.memphisyouthsoccer.com/availtest/reflog.php
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Did you do it like this:

    [code]
    var oTable = $('#log').dataTable({
    "sDom": 'T<"clear">lfrtip'
    });
    [/code]
    I don't see why that wouldn't work. Do you get any JS errors?

    Allan
  • jbeard03jbeard03 Posts: 13Questions: 0Answers: 0
    The error console in Firefox has an "invalid label" error (says the "sDom" line is an invalid lablel). Don't see any other errors (got two warnings about unknown properties in TableTools.css -- box-shadow & border-radius).

    My code is
    [code]var oTable = $('#log').dataTable();
    "sDom": 'T<"clear">lfrtip'
    new FixedHeader( oTable, { "left": true, "bottom": true } );
    });[/code]
  • jbeard03jbeard03 Posts: 13Questions: 0Answers: 0
    actually full code is

    [code]$(document).ready( function () {
    TableToolsInit.sSwfPath = "ZeroClipboard.swf";

    var oTable = $('#log').dataTable();
    "sDom": 'T<"clear">lfrtip'
    new FixedHeader( oTable, { "left": true, "bottom": true } );
    } ); [/code]
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Ah - you might have hit a bug in FixedHeader where it breaks for tables without a footer... Grab this script which has a fix committed: http://github.com/DataTables/FixedHeader/blob/master/js/FixedHeader.js

    Allan
  • jbeard03jbeard03 Posts: 13Questions: 0Answers: 0
    I already have that version (but downloaded and tried anyway). Doesn't seem to fix the footer problem for me - I have to have a footer to be able to freeze the left column. I did have the code incorrect above, I changed and it didn't fix TableTools problem but did let me turn off paginate. now code is
    [code] $(document).ready( function () {
    TableToolsInit.sSwfPath = "ZeroClipboard.swf";

    var oTable = $('#log').dataTable( {
    "bPaginate": false } );

    // "sDom": 'T<"clear">lfrti' } );

    new FixedHeader( oTable, { "left": true, "bottom": true } );
    } );[/code]

    If I uncomment the "sDom" line and replace } ); with a comma after "bPaginate" line then the Search box goes away and left column is no longer "frozen" AND the SWF is not displayed. But now I get a different error

    Error: document.getElementsByTagName("title")[0] is undefined
    Source File: http://www.memphisyouthsoccer.com/availtest/TableTools.js
    Line: 455

    I hope I am not doing something stupid and wasting your valuable time. I am more a hacker than a programmer unfortunately.
  • jbeard03jbeard03 Posts: 13Questions: 0Answers: 0
    OK - I am clearly not the sharpest tool in this shed. But maybe someone else is having the same problem. And I was at least smart enough to figure out how dumb I was. The table file must have a or TableTools will not work - this may also have affected the footer problem (footer required).

    The "box" appeared, but the "icons" are not being displayed - I can click on each area and the commands are activated (can save to clipboard, csv, excel and print), but no icons. I am looking in forum for an answer but if you can help this dummy please do.
  • jbeard03jbeard03 Posts: 13Questions: 0Answers: 0
    Never mind, I am not a complete idiot - just a little too close for my own standards. But even I understand that the browser can not display an image that is not provided. Image that - I uploaded the image files and it works!

    Not only are you extremely talented - you are good people. To provide this great code and support it for free (I am a bit strapped for cash at the moment, but I will make a donation soon) AND have patience with the likes of me - takes a special person like you. THANK YOU. (and from what I read, everyone else on the forum feels the same way)
This discussion has been closed.