ColReorder bug when first column is hidden

ColReorder bug when first column is hidden

StevenForrestStevenForrest Posts: 1Questions: 0Answers: 0

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

This discussion has been closed.