Browse Source

EntitiesTableWidgetComponent set rowPointer if has row/dblrow click action

pull/8960/head
deaflynx 3 years ago
parent
commit
7bd2df3233
  1. 3
      ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.html
  2. 3
      ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.ts

3
ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.html

@ -88,7 +88,8 @@
</ng-container> </ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns; sticky: enableStickyHeader"></mat-header-row> <mat-header-row *matHeaderRowDef="displayedColumns; sticky: enableStickyHeader"></mat-header-row>
<mat-row [ngClass]="{'tb-current-entity': entityDatasource.isCurrentEntity(entity), <mat-row [ngClass]="{'tb-current-entity': entityDatasource.isCurrentEntity(entity),
'invisible': entityDatasource.dataLoading}" 'invisible': entityDatasource.dataLoading,
'tb-pointer': rowPointer}"
*matRowDef="let entity; columns: displayedColumns; let row = index" *matRowDef="let entity; columns: displayedColumns; let row = index"
[ngStyle]="rowStyle(entity, row)" [ngStyle]="rowStyle(entity, row)"
(click)="onRowClick($event, entity)" (dblclick)="onRowClick($event, entity, true)"></mat-row> (click)="onRowClick($event, entity)" (dblclick)="onRowClick($event, entity, true)"></mat-row>

3
ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.ts

@ -150,6 +150,7 @@ export class EntitiesTableWidgetComponent extends PageComponent implements OnIni
public displayedColumns: string[] = []; public displayedColumns: string[] = [];
public entityDatasource: EntityDatasource; public entityDatasource: EntityDatasource;
public noDataDisplayMessageText: string; public noDataDisplayMessageText: string;
public rowPointer: boolean;
private setCellButtonAction: boolean; private setCellButtonAction: boolean;
private cellContentCache: Array<any> = []; private cellContentCache: Array<any> = [];
@ -278,6 +279,8 @@ export class EntitiesTableWidgetComponent extends PageComponent implements OnIni
this.setCellButtonAction = !!this.ctx.actionsApi.getActionDescriptors('actionCellButton').length; this.setCellButtonAction = !!this.ctx.actionsApi.getActionDescriptors('actionCellButton').length;
this.rowPointer = !!this.ctx.actionsApi.getActionDescriptors('rowClick').length || !!this.ctx.actionsApi.getActionDescriptors('rowDoubleClick').length;
if (this.settings.entitiesTitle && this.settings.entitiesTitle.length) { if (this.settings.entitiesTitle && this.settings.entitiesTitle.length) {
this.entitiesTitlePattern = this.utils.customTranslation(this.settings.entitiesTitle, this.settings.entitiesTitle); this.entitiesTitlePattern = this.utils.customTranslation(this.settings.entitiesTitle, this.settings.entitiesTitle);
} else { } else {

Loading…
Cancel
Save