Column resizing problem
Column resizing problem
jahljves
Posts: 3Questions: 1Answers: 0
in ColReorder
Hello,
I'm trying to use this plugin but there is a little problem that bother me...
The columns can be reordered, no problem here, but when I drag and drop a column elsewhere, instead of just reordered them, the plugin is resizing all the columns...
They are much much bigger than berfore, and I have no idea why.
Can somebody help me please ?
Regards !
This discussion has been closed.
Answers
Can you link to a page showing the issue please. The example here appears to work okay: https://datatables.net/extensions/colreorder/ .
Allan
Thanks for your quick answer.
Here are some screenshots of the problem. You can see on the first one that the columns are normaly sized. Then I use ColReorder to move a column to another place. It works, but you can see on the second screen that the size is immense !
http://image.noelshack.com/fichiers/2014/21/1400681593-tab1.jpg
http://image.noelshack.com/fichiers/2014/21/1400681601-tab2.jpg
I really do not have a single idea of what's going on...
Thank you !
Hi,
I solved my problem.
This is the solution :
"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"