FixedColumns 2.5.0: width calculation bug when sorting

FixedColumns 2.5.0: width calculation bug when sorting

alexwayhillalexwayhill Posts: 4Questions: 0Answers: 0
edited January 2014 in Plug-ins
I'm running into an issue with width calculation of fixed columns using the latest FixedColumns 2.5.0. On first draw the fixed columns' widths are calculated correctly and everything looks fine but as soon as a user does a column sort, parts of the unfixed columns may get hidden behind the fixed column part. I assume that the problem is caused because the column width of the fixed column overlay is calculated and rendered on initialisation whereas the datatable column width changes dynamically when sorting causing the underlying datatable grid to change width without re-rendering the overlay. This is my initialisation code for dataTable and FixedColumns:

[code]
oTable = $('#matrix').dataTable({
"bProcessing": true,
"sScrollX": "100%",
"bScrollCollapse": true,
"bJQueryUI": true,
"sAjaxSource": urlBackend,
...
"fnInitComplete": function () {
try {
new FixedColumns(oTable, {
"iLeftColumns": 10
});
} catch (e) {
console.log(e);
}
}
});
[/code]

To give you an impression of the bug, here is a picture showing the problem after a sort: http://img.picshare.at/1390218859_datatables-fixedcolumns-sorting.JPG (the partly hidden column would be "Part 1").

Thanks a lot for pointing me into the right direction!

Replies

  • allanallan Posts: 57,686Questions: 1Answers: 9,195 Site admin
    Can you link to a test case showing this problem please? I'd like to release FixedColumns 2.5.0 this week, so it would be good to be able to resolve this problem.

    Allan
  • alexwayhillalexwayhill Posts: 4Questions: 0Answers: 0
    Hi Allan,

    sorry for the late reply, I hadn't received a notification about your response. I will see if I can set up a playground on the weekend, will get back to this thread as soon as I am done with it. Thanks in advance for your work and troubles!

    Sascha
  • allanallan Posts: 57,686Questions: 1Answers: 9,195 Site admin
    Thanks for the reply. Its too late for v3 (I bumped 2.5.0 to v3.0.0) as I've tagged and released that now, but a test case would still be great so I can fix it in a bug fix release, if indeed it is a bug in FixedColumns.

    Allan
This discussion has been closed.