mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-10-08 13:44:18 +00:00
Core: get accurate column count. Fixes #840
This commit is contained in:
parent
979b3e5ddc
commit
2e398259b3
5
dist/js/jquery.tablesorter.js
vendored
5
dist/js/jquery.tablesorter.js
vendored
@ -1252,7 +1252,6 @@
|
|||||||
ts.computeColumnIndex = function(trs) {
|
ts.computeColumnIndex = function(trs) {
|
||||||
var matrix = [],
|
var matrix = [],
|
||||||
lookup = {},
|
lookup = {},
|
||||||
cols = 0, // determine the number of columns
|
|
||||||
i, j, k, l, $cell, cell, cells, rowIndex, cellId, rowSpan, colSpan, firstAvailCol, matrixrow;
|
i, j, k, l, $cell, cell, cells, rowIndex, cellId, rowSpan, colSpan, firstAvailCol, matrixrow;
|
||||||
for (i = 0; i < trs.length; i++) {
|
for (i = 0; i < trs.length; i++) {
|
||||||
cells = trs[i].cells;
|
cells = trs[i].cells;
|
||||||
@ -1274,7 +1273,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
lookup[cellId] = firstAvailCol;
|
lookup[cellId] = firstAvailCol;
|
||||||
cols = Math.max(firstAvailCol, cols);
|
|
||||||
// add data-column
|
// add data-column
|
||||||
$cell.attr({ 'data-column' : firstAvailCol }); // 'data-row' : rowIndex
|
$cell.attr({ 'data-column' : firstAvailCol }); // 'data-row' : rowIndex
|
||||||
for (k = rowIndex; k < rowIndex + rowSpan; k++) {
|
for (k = rowIndex; k < rowIndex + rowSpan; k++) {
|
||||||
@ -1288,8 +1286,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// may not be accurate if # header columns !== # tbody columns
|
return matrixrow.length;
|
||||||
return cols + 1; // add one because it's a zero-based index
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// *** Process table ***
|
// *** Process table ***
|
||||||
|
2
dist/js/jquery.tablesorter.min.js
vendored
2
dist/js/jquery.tablesorter.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1252,7 +1252,6 @@
|
|||||||
ts.computeColumnIndex = function(trs) {
|
ts.computeColumnIndex = function(trs) {
|
||||||
var matrix = [],
|
var matrix = [],
|
||||||
lookup = {},
|
lookup = {},
|
||||||
cols = 0, // determine the number of columns
|
|
||||||
i, j, k, l, $cell, cell, cells, rowIndex, cellId, rowSpan, colSpan, firstAvailCol, matrixrow;
|
i, j, k, l, $cell, cell, cells, rowIndex, cellId, rowSpan, colSpan, firstAvailCol, matrixrow;
|
||||||
for (i = 0; i < trs.length; i++) {
|
for (i = 0; i < trs.length; i++) {
|
||||||
cells = trs[i].cells;
|
cells = trs[i].cells;
|
||||||
@ -1274,7 +1273,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
lookup[cellId] = firstAvailCol;
|
lookup[cellId] = firstAvailCol;
|
||||||
cols = Math.max(firstAvailCol, cols);
|
|
||||||
// add data-column
|
// add data-column
|
||||||
$cell.attr({ 'data-column' : firstAvailCol }); // 'data-row' : rowIndex
|
$cell.attr({ 'data-column' : firstAvailCol }); // 'data-row' : rowIndex
|
||||||
for (k = rowIndex; k < rowIndex + rowSpan; k++) {
|
for (k = rowIndex; k < rowIndex + rowSpan; k++) {
|
||||||
@ -1288,8 +1286,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// may not be accurate if # header columns !== # tbody columns
|
return matrixrow.length;
|
||||||
return cols + 1; // add one because it's a zero-based index
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// *** Process table ***
|
// *** Process table ***
|
||||||
|
Loading…
Reference in New Issue
Block a user