From 32f15145dcce0fdabe268319159a65b7fcbe96de Mon Sep 17 00:00:00 2001 From: Akshat Patel Date: Thu, 13 Jun 2024 11:13:19 -0400 Subject: [PATCH] fix: trigger check to see if all checkboxes are selected after data is set Signed-off-by: Akshat Patel --- src/table/table.component.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/table/table.component.ts b/src/table/table.component.ts index 9f34a2a6b8..9e847c6fe6 100644 --- a/src/table/table.component.ts +++ b/src/table/table.component.ts @@ -2,6 +2,7 @@ import { Component, ApplicationRef, Input, + OnInit, Output, EventEmitter, ElementRef, @@ -247,7 +248,7 @@ import { TableRowSize } from "./table.types"; } `] }) -export class Table implements AfterViewInit, OnDestroy { +export class Table implements OnInit, AfterViewInit, OnDestroy { /** * Creates a skeleton model with a row and column count specified by the user * @@ -648,6 +649,12 @@ export class Table implements AfterViewInit, OnDestroy { protected i18n: I18n ) { } + ngOnInit() { + // Manually trigger check to see if all checkboxes are selected + // This is since subscription is made AFTER checkboxes are selected + this.updateSelectAllCheckbox(); + } + ngAfterViewInit() { this.isViewReady = true; if (this.isDataGrid) {