Skip to content

Commit

Permalink
Add a footer to the table in the example app
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkCuypersPpw committed Aug 27, 2024
1 parent c7d19de commit 75ebd7e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/app/filter-table/filter-table.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<mat-card-content>
<ppw-table
[data]="players.entity.items"
[footerData]="footerData"
[enableRowSelection]="true"
[enableRowDrag]="enableRowDrag"
[options]="tableOptions"
Expand Down
12 changes: 12 additions & 0 deletions src/app/filter-table/filter-table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ export class FilterTableComponent
public enableRowDrag = false
public searchForm!: FormGroup
public lastClickedRow?: Player
public footerData: Partial<Player> = {
firstName: 'Total:',
income: 168000
}

public tableOptions: PpwTableOptions<Player> = {
header: {
Expand All @@ -166,6 +170,14 @@ export class FilterTableComponent
}
}
},
footer: {
sticky: true,
styles: {
firstName: () => {
return { 'text-align': 'right' }
}
}
},
columns: {
ignoreClick: ['active'],
styles: {
Expand Down
10 changes: 10 additions & 0 deletions src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,16 @@ ppw-wireframe.flat {
text-align: right;
}

table {
tfoot {
tr {
td {
font-weight: bold;
}
}
}
}

.clickable-list-item {
transition: all 0.2s;
cursor: pointer;
Expand Down

0 comments on commit 75ebd7e

Please sign in to comment.