Skip to content

feat: support for custom row height in table widget #1310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 7, 2021
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
2 changes: 1 addition & 1 deletion projects/components/src/table/table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ import { TableColumnConfigExtended, TableService } from './table.service';
selectable: this.supportsRowSelection()
}"
class="data-row"
[style.height]="this.rowHeight"
[style.minHeight]="this.rowHeight"
></cdk-row>

<!-- Expandable Detail Rows -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ export abstract class TableWidgetBaseModel extends BaseModel {
})
public resizable: boolean = true;

@ModelProperty({
key: 'row-height',
displayName: 'Row Height',
type: STRING_PROPERTY.type
})
public rowHeight: string = '44px';

@ModelProperty({
key: 'loadingConfig',
required: false,
Expand Down Expand Up @@ -196,6 +203,10 @@ export abstract class TableWidgetBaseModel extends BaseModel {
return this.resizable;
}

public getRowHeight(): string {
return this.rowHeight;
}

public getLoadingConfig(): LoadAsyncConfig | undefined {
return this.loadingConfig;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ import { TableWidgetModel } from './table-widget.model';
[resizable]="this.api.model.isResizable()"
[detailContent]="childDetail"
[syncWithUrl]="this.syncWithUrl"
[rowHeight]="this.api.model.getRowHeight()"
(rowClicked)="this.onRowClicked($event)"
(selectionsChange)="this.onRowSelection($event)"
(columnConfigsChange)="this.onColumnsChange($event)"
Expand Down