FixedColumns

FixedColumns

ddudley3ddudley3 Posts: 20Questions: 0Answers: 0
edited March 2013 in DataTables 1.9
Having troubles getting the example for this to work.
http://datatables.net/release-datatables/extras/FixedColumns/index.html

using FF v19.0.2
have the following html (more than 6 cols obv)

[code]



Test

@import "media/css/demo_page.css";
@import "media/css/demo_table.css";
@import "media/css/style.css";





$(document).ready(function() {
var oTable = $('#example').dataTable( {
"sScrollX": 200,
"bProcessing": true,
"sAjaxSource": 'newjson.txt'
}
);
new FixedColumns( oTable );
} );






Col 1
Col 2
Col 3
Col 4
Col 5
Col 6







[/code]

Am I missing something? It's not fixing the first column in this scenario. Nor is the example one on your website if you hit the jsbin option on the page.

Replies

  • allanallan Posts: 63,389Questions: 1Answers: 10,449 Site admin
    Please link to the page you are working on: http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read .

    I'd also say that sScrollX should never be anything other than `"100%"` . It can be 200 or anything else, but you'd be much better off making the overall container 200px if that is what you need.

    Allan
  • ddudley3ddudley3 Posts: 20Questions: 0Answers: 0
    ok. Having trouble finding a place to put this on a public website to have it to show you. JSFiddle, sites.google.com, don't work. Any other suggestions?
  • allanallan Posts: 63,389Questions: 1Answers: 10,449 Site admin
    Why doesn't JSFiddle work? It should. Or you could use http://live.datatables.net .

    Allan
  • ddudley3ddudley3 Posts: 20Questions: 0Answers: 0
    With JsFiddle I can't add script tags with src="" references. Not sure if

    [code]Live.datatables.net[/code]

    includes everything by default such as
    [code]

    [/code]

    ?
  • ddudley3ddudley3 Posts: 20Questions: 0Answers: 0
    If live.datatables.net is supposed to have everything... then simply change the javascript side to

    [code]
    $(document).ready(function() {
    var oTable = $('#example').dataTable( {
    "sScrollX": "100%"
    }
    );
    new FixedColumns( oTable );
    } );
    [/code]

    and you will see it's not happening.
  • allanallan Posts: 63,389Questions: 1Answers: 10,449 Site admin
    http://live.datatables.net/ojidiz/edit#javascript,html

    Looks like it is working to me. The table there doesn't need scrolling, so it doesn't use it.

    Allan
  • ddudley3ddudley3 Posts: 20Questions: 0Answers: 0
    ok. Here's what I'm doing which is not fixing any columns at all.


    Javascript side
    [code]
    $(document).ready(function() {
    var oTable = $('#example').dataTable( {
    "sScrollY": "300px",
    "sScrollX": "100%",
    "sScrollXInner": "150%",
    "bScrollCollapse": true,
    "bPaginate": false,
    }
    );
    new FixedColumns( oTable );
    } );
    [/code]

    Html side has all standard stuff.
    Added

    [code]


    [/code]
    in the head tag

    and
    used this for every column (could not paste all of the html.. ran over number of chars for post)
    add many more
    [code]




    Col 1
    Col 2
    Col 3
    Col 4
    Col 5
    Col 6
    Col 7
    Col 8
    Col 9
    Col 10




    1234567890123456789012345678901234567890
    1234567890123456789012345678901234567890
    1234567890123456789012345678901234567890
    1234567890123456789012345678901234567890
    1234567890123456789012345678901234567890
    1234567890123456789012345678901234567890
    1234567890123456789012345678901234567890
    1234567890123456789012345678901234567890
    1234567890123456789012345678901234567890
    1234567890123456789012345678901234567890







    [/code]
  • ddudley3ddudley3 Posts: 20Questions: 0Answers: 0
    I have figured out that IE8 doesn't like that FixedColumn.js It's giving an error showing "$.browser.msie" is null or not an object. FF loads it, shows no errors and does nothing to fix the column.
  • allanallan Posts: 63,389Questions: 1Answers: 10,449 Site admin
    That's jQuery 1.9. Use the 2.5.0.dev FixedColumns version : http://datatables.net/download/
  • ddudley3ddudley3 Posts: 20Questions: 0Answers: 0
    yeah the ColVis too. I backed off to the one in the folder you have with the Data Tables download (1.8.2) for now.
This discussion has been closed.