Skip to content

Commit 17da1f5

Browse files
authored
Merge pull request #2921 from Akshat55/issue.2915
fix: trigger check to see if all checkboxes are selected after data is set
2 parents 3e36538 + dfce8fa commit 17da1f5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/table/table.component.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {
22
Component,
33
ApplicationRef,
44
Input,
5+
OnInit,
56
Output,
67
EventEmitter,
78
ElementRef,
@@ -247,7 +248,7 @@ import { TableRowSize } from "./table.types";
247248
}
248249
`]
249250
})
250-
export class Table implements AfterViewInit, OnDestroy {
251+
export class Table implements OnInit, AfterViewInit, OnDestroy {
251252
/**
252253
* Creates a skeleton model with a row and column count specified by the user
253254
*
@@ -648,6 +649,12 @@ export class Table implements AfterViewInit, OnDestroy {
648649
protected i18n: I18n
649650
) { }
650651

652+
ngOnInit() {
653+
// Manually trigger check to see if all checkboxes are selected
654+
// This is since subscription is made AFTER checkboxes are selected
655+
this.updateSelectAllCheckbox();
656+
}
657+
651658
ngAfterViewInit() {
652659
this.isViewReady = true;
653660
if (this.isDataGrid) {

0 commit comments

Comments
 (0)