fix(check-all): fix column collection

This commit is contained in:
Gregor Kleen 2020-06-26 17:40:00 +02:00
parent 3dd134cb21
commit 9935efe966
2 changed files with 12 additions and 3 deletions

View File

@ -1,4 +1,4 @@
const DEBUG_MODE = /localhost/.test(window.location.href) ? 1 : 0;
const DEBUG_MODE = /localhost/.test(window.location.href) ? 0 : 0;
import * as defer from 'lodash.defer';

View File

@ -1,3 +1,5 @@
const DEBUG_MODE = /localhost/.test(window.location.href) ? 0 : 0;
import { Utility } from '../../core/utility';
import { TableIndices } from '../../lib/table/table';
@ -30,6 +32,10 @@ export class CheckAll {
this._tableIndices = new TableIndices(this._element);
this._gatherColumns();
if (DEBUG_MODE > 0)
console.log(this._columns);
this._findCheckboxColumns().forEach(columnId => this._checkAllColumns.push(new CheckAllColumn(this._element, app, this._columns[columnId])));
// mark initialized
@ -37,8 +43,11 @@ export class CheckAll {
}
_gatherColumns() {
for (const rowIndex of new Array(this._tableIndices.maxRow + 1)) {
for (const colIndex of new Array(this._tableIndices.maxCol + 1)) {
for (const rowIndex of Array(this._tableIndices.maxRow + 1).keys()) {
for (const colIndex of Array(this._tableIndices.maxCol + 1).keys()) {
if (DEBUG_MODE > 1)
console.log(rowIndex, colIndex);
const cell = this._tableIndices.getCell(rowIndex, colIndex);
if (!cell)