From 322631c74c79d059409594bcaf033f22501816f7 Mon Sep 17 00:00:00 2001 From: "mouaz.alkhodari" Date: Thu, 3 Mar 2022 19:57:11 +0200 Subject: [PATCH] Add action custom flag to correct colspan for no data row --- .../src/lib/components/tbody/tbody.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/projects/ng2-smart-table/src/lib/components/tbody/tbody.component.ts b/projects/ng2-smart-table/src/lib/components/tbody/tbody.component.ts index f0c830eac..685a3ea31 100644 --- a/projects/ng2-smart-table/src/lib/components/tbody/tbody.component.ts +++ b/projects/ng2-smart-table/src/lib/components/tbody/tbody.component.ts @@ -36,10 +36,11 @@ export class Ng2SmartTableTbodyComponent { isActionAdd: boolean; isActionEdit: boolean; isActionDelete: boolean; + isCustomActions: boolean; noDataMessage: boolean; get tableColumnsCount() { - const actionColumns = this.isActionAdd || this.isActionEdit || this.isActionDelete ? 1 : 0; + const actionColumns = this.isActionAdd || this.isActionEdit || this.isActionDelete || this.isCustomActions ? 1 : 0; return this.grid.getColumns().length + actionColumns; } @@ -52,6 +53,7 @@ export class Ng2SmartTableTbodyComponent { this.isActionAdd = this.grid.getSetting('actions.add'); this.isActionEdit = this.grid.getSetting('actions.edit'); this.isActionDelete = this.grid.getSetting('actions.delete'); + this.isCustomActions = !!this.grid.getSetting('actions.custom'); this.noDataMessage = this.grid.getSetting('noDataMessage'); }