compatible jquery versions for fixedcolumns 2.5.0-dev

compatible jquery versions for fixedcolumns 2.5.0-dev

alongtheivyalongtheivy Posts: 21Questions: 1Answers: 0
edited January 2014 in General
I am trying to use fixedcolumns 2.5.0-dev with
jquery-ui 1.10.3
jquery-validate
jquery-notify
jquery-scrollto
jquery 1.7.1
jquery datatables 1.10.0-dev
jquery-jeditable

should all of these be compatible with fixedcolumns? or only certain versions? I am getting errors when I add fixedcolumns and initialize it like so:
[code]
var fixedTable = new FixedColumns( dTable, {
"iLeftColumns": 2,
"iLeftWidth" : 130
} );
[/code]


on a datatable initialized like this:

[code]
dTable = $table.dataTable({
"sDom" : "t",
"oLanguage" : {
"sLengthMenu": "_MENU_ records per page"
},
"bSort" : false,
"bPaginate" : false,
'sScrollX' : '100%',
'sScrollXInner' : Math.max(screen.width - SCROLL_BAR_WIDTH, DEFAULT_TABLE_WIDTH) + 'px',
"sScrollY" : TABLE_HEIGHT,
"bScrollCollapse" : true,
'bDestroy' : true,
'fnRowCallback' : createTableRow,
"aaData" : selectData(stations),
"aoColumns": [/*etc*/]
});
[/code]
I was getting these errors just by adding the fixedcolumns in

[code]
Uncaught TypeError: Cannot read property '0' of undefined FixedColumns.js:865
3Uncaught TypeError: Cannot call method 'removeChild' of null

[/code]

a test case is not available. I'm mainly wondering about the compatibility with fixedcolumns, since I know understanding errors without a test case is near impossible. Thank you!

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Yes, it should work no problem with 1.7.

    Could you try the very latest version of FixedColumns please? Line 865 in the current dev version is empty: https://github.com/DataTables/FixedColumns/blob/master/media/js/dataTables.fixedColumns.js#L865 .

    I think my "nightly" script for FixedColumns is a little broken at the moment, so you might want to just grab it from github just now.

    Thanks,
    Allan
  • alongtheivyalongtheivy Posts: 21Questions: 1Answers: 0
    will do! Thanks.
  • alongtheivyalongtheivy Posts: 21Questions: 1Answers: 0
    Just to update, using the new fixedColumns got rid of the errors, but my datatables do not show properly. First, the datatable shows up fine, but the columns aren't fixed or anything, it's just a normal datatable. Then I click to other datatables I haven't used fixedcolumns on and they all work fine. I try to click back to show the datatable using fixedcolumns and it refuses to show again.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    We'd need a test page showing the problem to be able to debug it.

    Allan
  • alongtheivyalongtheivy Posts: 21Questions: 1Answers: 0
    Ok, had to fix a few things. Setting the background color of the fixed columns to white and when it has a scrollbar they are fixed when you FIRST open the page. I have different tabs with different datatables. If you click to another tab and click back to the original, the datatable data is NOT affected negatively, but the fixed columns loses their fixed structure. Since I cannot use the initialization:

    [code]
    var fixedTable = new FixedColumns( dTable, {
    "iLeftColumns": 2,
    "iLeftWidth" : 133
    } );
    [/code]

    more than once, do you have an idea of what is erasing the fixed column functionality? Maybe the datatable thinks it's already doing fixed columns? Is there a way to "restart" fixed columns, or maybe hide the old initialization from the program if you've already clicked on it once?

    I know it's a shot in the dark without providing a test case, but it boggles my mind that it would work perfectly until you click to another tab and click back.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    > "iLeftWidth" : 133

    Has no effect in 2.5 - the width is read entirely from the host DataTable. The parameter is ignored.

    I'm afraid I'm guessing only, and without a test case, unfortunately there is a very good change that this is going to remain an issue in the release version of 2.5.0.

    I can't really understand why it would work initially and then not when you refocus on a tab. Are you calling fnAdjustColumnSizing or anything like that? What does your full initialisation code look like? Is it behind a firewall or can you PM me a link?

    Allan
  • alongtheivyalongtheivy Posts: 21Questions: 1Answers: 0
    it's behind a firewall, but I could PM you some code, if you give me an address to send to.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    allan @ this domain .n et :-)

    Allan
  • alongtheivyalongtheivy Posts: 21Questions: 1Answers: 0
    for anyone following this question, Allan solved my problem with the latest FixedColumns

    http://datatables.net/download/build/dataTables.fixedColumns.nightly.js?1
This discussion has been closed.