Skip to content

Commit 9304ded

Browse files
authored
Merge pull request #2072 from Licen-it/master
fix(TableModel): setting totalDataLength to 0 is no longer ignoring it and selectAll is no longer selecting empty row
2 parents e497cda + e38bdf1 commit 9304ded

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/table/table-model.class.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export class TableModel implements PaginationModel {
156156
*/
157157
set totalDataLength(length: number) {
158158
// if this function is called without a parameter we need to set to null to avoid having undefined != null
159-
this._totalDataLength = length || null;
159+
this._totalDataLength = isNaN(length) ? null : length;
160160
}
161161

162162
/**
@@ -621,7 +621,7 @@ export class TableModel implements PaginationModel {
621621
* @param value state to set all rows to. Defaults to `true`
622622
*/
623623
selectAll(value = true) {
624-
if (this.data.length >= 1) {
624+
if (this.data.length >= 1 && this.data[0].length >= 1) {
625625
for (let i = 0; i < this.rowsSelected.length; i++) {
626626
this.selectRow(i, value);
627627
}

0 commit comments

Comments
 (0)