ColReorder bug when first column is hidden
ColReorder bug when first column is hidden
colReorder does not handle the first column being hidden properly.
visual indicator of column is positioned wrongly.
Problem: in _fwRegions the variable totals is initialized to the offset.left of the first column, not the first visible column.
My solution: add logic to add the offset.left to total inside the check for visible column.
ColReorder 1.3.1
line: 1061
-- var total = $(aoColumns[0].nTh).offset().left; // Offset of the first column
++ var total = 0;
++ var first = true;
...
if ( aoColumns[i].bVisible && aoColumns[i].nTh.style.display !=='none' )
{
++ if (first)
++ {
++ total = $(aoColumns[i].nTh).offset().left; // Offset of the first visible column
++ first = false;
++ }
total += $(aoColumns[i].nTh).outerWidth();
Replies
Thanks for letting me know about that. Example showing the issue here: http://live.datatables.net/qedipabo/1/edit .
I'll post back when fixed!
Allan
Oops - I had forgotten that this is fixed in ColReorder 1.3.2 (the current release)!
This was the commit that fixed it.
Allan