search: string
rowsPerPageOptions = [ 10, 20, 50, 100 ]
rowsPerPage = this.rowsPerPageOptions[0]
+ expandedRows = {}
private searchStream: Subject<string>
this.searchStream.next(target.value)
}
+ onPage (event: { first: number, rows: number }) {
+ if (this.rowsPerPage !== event.rows) {
+ this.rowsPerPage = event.rows
+ this.pagination = {
+ start: event.first,
+ count: this.rowsPerPage
+ }
+ this.loadData()
+ }
+ this.expandedRows = {}
+ }
+
+ setTableFilter (filter: string) {
+ // FIXME: cannot use ViewChild, so create a component for the filter input
+ const filterInput = document.getElementById('table-filter') as HTMLInputElement
+ if (filterInput) filterInput.value = filter
+ }
+
+ resetSearch () {
+ this.searchStream.next('')
+ this.setTableFilter('')
+ }
+
protected abstract loadData (): void
private getSortLocalStorageKey () {