ColReorder and FixedColumns Integration Problem
ColReorder and FixedColumns Integration Problem
aldrin
Posts: 3Questions: 1Answers: 0
in ColReorder
Does anyone have a solution for the ColReorder to work properly with FixedColumns?
The widths of the columns expand when you try to reorder them, as in this example.
Any help will be much appreciated. Thank you.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Thanks for flagging this up. I'll take a look into it as soon as I can.
Allan
Thank you Allan and many thanks for the DataTables.
Hi Allan,
I think there is a regexp bug in a folowing line:
https://github.com/DataTables/DataTables/blob/master/media/js/jquery.dataTables.js#L594
var t = (th.attr('style') || '').match(/width:\s*(\d+[pxem%])/);
I guess it should be something like below instead
var t = (th.attr('style') || '').match(/width:\s*(\d+(px|em|%))/);
What it means is that sWidthOrig setting on column is getting a wrong value (trimmed "x" from the "px" setting, fo example "130p" instead of "130px") thus making columns to expand significantly. Changing the line as suggested helped me to get rid of this column reordering problem.
Gleb
Hi Allan,
Thanks again for your incredible support. Just about every issue I've had with setting up DataTables has been addressed personally by you in these forums. Awesome.
I just wanted to check on your progress with this ColReorder + scrollX fix. Is there somewhere I can track its progress?
Thank you, good sir.
Thanks for bumping this up - I've been meaning to take a look at it for a while.
Two fixes needed:
I'm going to be releasing DataTables 1.10.1 soon, and I'll also repackage ColReorder for a minor release as well. In the mean time, the nightly version on the downloads page is up to date with this fix.
Allan
You're welcome, and thank you for getting back so quickly. I'll switch to the nightly should 1.10.1's release be a bit delayed. Cheers!
Thank you very much @allan... :)