diff options
Diffstat (limited to 'client/src/app/shared/rest')
-rw-r--r-- | client/src/app/shared/rest/rest-table.ts | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/client/src/app/shared/rest/rest-table.ts b/client/src/app/shared/rest/rest-table.ts index 4dd0f5ff3..d4e6cf5f2 100644 --- a/client/src/app/shared/rest/rest-table.ts +++ b/client/src/app/shared/rest/rest-table.ts | |||
@@ -74,10 +74,29 @@ export abstract class RestTable { | |||
74 | this.searchStream.next(target.value) | 74 | this.searchStream.next(target.value) |
75 | } | 75 | } |
76 | 76 | ||
77 | onPage () { | 77 | onPage (event: { first: number, rows: number }) { |
78 | if (this.rowsPerPage !== event.rows) { | ||
79 | this.rowsPerPage = event.rows | ||
80 | this.pagination = { | ||
81 | start: event.first, | ||
82 | count: this.rowsPerPage | ||
83 | } | ||
84 | this.loadData() | ||
85 | } | ||
78 | this.expandedRows = {} | 86 | this.expandedRows = {} |
79 | } | 87 | } |
80 | 88 | ||
89 | setTableFilter (filter: string) { | ||
90 | // FIXME: cannot use ViewChild, so create a component for the filter input | ||
91 | const filterInput = document.getElementById('table-filter') as HTMLInputElement | ||
92 | if (filterInput) filterInput.value = filter | ||
93 | } | ||
94 | |||
95 | resetSearch () { | ||
96 | this.searchStream.next('') | ||
97 | this.setTableFilter('') | ||
98 | } | ||
99 | |||
81 | protected abstract loadData (): void | 100 | protected abstract loadData (): void |
82 | 101 | ||
83 | private getSortLocalStorageKey () { | 102 | private getSortLocalStorageKey () { |