Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions projects/centeva-core/src/common/models/table-column.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export type SelectColumn = TableColumnBase & {

export type MultiSelectColumn = TableColumnBase & {
DataType: ColumnDataTypes.MULTISELECT,
OptionTemplate?: TemplateRef<unknown>;
Options: any[];
OptionValueProperty?: string;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<mat-label>{{ column.Name }}</mat-label>
<mat-select [formControlName]="column.Property" (selectionChange)="filterOrValueChanged(column)" matTooltip="Select all that apply" multiple>
<mat-option *ngFor="let option of column.Options" [value]="option[column.OptionValueProperty]">
{{ option.Name }}
<ng-container [ngTemplateOutlet]="column.OptionTemplate ?? defaultMultiSelectOption" [ngTemplateOutletContext]="{ option: option }"></ng-container>
</mat-option>
</mat-select>
<button mat-icon-button matSuffix *ngIf="formGroup.controls[column.Property]?.value?.length > 0" (click)="clearFilter(column, $event)" [attr.aria-label]="'Clear'">
Expand Down Expand Up @@ -172,3 +172,7 @@
{{ (row[column.Property] | dynamic: column.Pipe?.Pipe:column.Pipe?.Values || el )}}
</mat-checkbox>
</ng-template>

<ng-template #defaultMultiSelectOption let-option="option">
{{option.Name}}
</ng-template>
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export class TableComponent implements OnInit {
@ViewChild('defaultColumn', { static: true }) defaultColumnRef: TemplateRef<undefined>;
@ViewChild('linkColumn', { static: true }) linkRef: TemplateRef<undefined>;
@ViewChild('checkboxColumn', { static: true }) checkboxRef: TemplateRef<undefined>;
@ViewChild('defaultMultiSelectOption', { static: true }) defaultMultiSelectOptionRef: TemplateRef<undefined>;

private _displayedColumns: TableColumn[];
private _dataSource: any;
Expand Down