]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/shared/rest/rest-table.ts
Implement header design
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / rest / rest-table.ts
1 import { LazyLoadEvent } from 'primeng/components/common/lazyloadevent'
2 import { SortMeta } from 'primeng/components/common/sortmeta'
3
4 import { RestPagination } from './rest-pagination'
5
6 export abstract class RestTable {
7 abstract totalRecords: number
8 abstract rowsPerPage: number
9 abstract sort: SortMeta
10 abstract pagination: RestPagination
11
12 protected abstract loadData (): void
13
14 loadLazy (event: LazyLoadEvent) {
15 this.sort = {
16 order: event.sortOrder,
17 field: event.sortField
18 }
19
20 this.pagination = {
21 start: event.first,
22 count: this.rowsPerPage
23 }
24
25 this.loadData()
26 }
27
28 }