FixedColumns: Scroll ok, but fixed column not?

FixedColumns: Scroll ok, but fixed column not?

thowithowi Posts: 67Questions: 7Answers: 0
edited January 2014 in General
Hi all together,

I just added horizontal scroll to my table successfully and now I'd like to fix the left column. I tried that usind the example here: http://datatables.net/release-datatables/extras/FixedColumns/themed.html

My code now looks like:
[code]$(document).ready(function () {
var saleTable = $('#tabs-3 table.display').dataTable({
"sScrollX": "100%",
"bScrollCollapse": true,
"oLanguage": {
"sSearch": "Global search:"
},
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"sDom": '<"H"Tfr>t<"F"ip>',
//"oSearch": {"bSmart": false},
"oTableTools": {
"sSwfPath": "modules/rfid/tools/jQueryUI/datatable/media/swf/copy_csv_xls_pdf.swf",
"aButtons": [
"copy", "csv", "xls", "pdf"/*,{
"sExtends": "collection",
"sButtonText": "Save",
"aButtons": [ "csv", "xls", "pdf" ]
}*/
]
}
});
new FixedColumns( saleTable );
});[/code]

The scrolling works well, but the left column is not fixed. Autowidth is working properly like expected.
Am I doing something wrong? I'd be happy to hear your thoughts.

Cheers,
thowi

Replies

  • netametanetameta Posts: 39Questions: 0Answers: 0
    read: http://datatables.net/forums/discussion/18881/trying-to-use-fixedcolumn-but-for-somereason-it-wont-work-at-all-#Item_18 i had some issues with it also
  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
    Also please link to a test case, as with all threads.

    Allan
  • thowithowi Posts: 67Questions: 7Answers: 0
    Hi!

    Thank you for your comments. I'll take a look at your code, thanks for that!
    Also, here you can see the site where it occurs:

    http://rfid.ocserv.de/
    user: demo
    pass: demo

    After login click "RFID Product Management" and then click "view database content".

    Cheers,
    thowi
  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
    If you look at the console in your browser:

    > ReferenceError: Can't find variable: FixedColumns

    Are you including the FixedColumns JS file?
  • thowithowi Posts: 67Questions: 7Answers: 0
    edited January 2014
    Yeah, great hint! I missed that. I of course took a look at your example on http://datatables.net/release-datatables/extras/FixedColumns/index.html but I was not aware of the fact that another .js file is needed for that.

    Now I included that. Console says:
    ReferenceError: reference to undefined property $.browser
    TypeError: $.browser is undefined
    in FixedColumns.js.

    Also the fact that I added 'new FixedColumns( saleTable );' crashed my jQueryUI accordion in tab "Update Database Content", which worked before. I don't know if this helps you, but maybe good 2 know:

    [code]
    $(document).ready(function () {
    $( "#database_update" ).accordion({
    heightStyle: "content"
    });
    });
    [/code]
  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
    Use the file from here: https://github.com/DataTables/FixedColumns/tree/master/media/js . That fixes the issue.
  • thowithowi Posts: 67Questions: 7Answers: 0
    Okay, I just used that file and beside message
    TypeError: anonymous function does not always return a value in FixedColumns.js
    I now have many reference errors in dataTables.js - and the whole table crashed. Beside, FixedColumns seem not to work anyhow.
  • thowithowi Posts: 67Questions: 7Answers: 0
    edited January 2014
    By "crash" I mean looking like here: https://dl.dropboxusercontent.com/u/1625441/screen.jpg
    But the strange thing is: when resizing the browser window a little bit it disappears. Okay so far... but yes, left column is not being fixed.

    I also tried specifying the FixedColumns a little bit by adding [code]{ "iLeftColumns": 1, "iRightColumns": 1 }[/code] to see if something is somehow happening.
    Now the header of my left right column is shown left and fixed, but the content is not... interesting :)
This discussion has been closed.