- <p-dataTable
- [value]="users" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
- sortField="id" (onLazyLoad)="loadLazy($event)"
- >
- <p-column field="id" header="ID" [sortable]="true"></p-column>
- <p-column field="username" header="Username" [sortable]="true"></p-column>
- <p-column field="email" header="Email"></p-column>
- <p-column field="videoQuota" header="Video quota"></p-column>
- <p-column field="role" header="Role"></p-column>
- <p-column field="createdAt" header="Created date" [sortable]="true"></p-column>
- <p-column header="Edit" styleClass="action-cell">
- <ng-template pTemplate="body" let-user="rowData">
- <a [routerLink]="getRouterUserEditLink(user)" title="Edit this user">
- <span class="glyphicon glyphicon-pencil glyphicon-black"></span>
- </a>
- </ng-template>
- </p-column>
- <p-column header="Delete" styleClass="action-cell">
- <ng-template pTemplate="body" let-user="rowData">
- <span (click)="removeUser(user)" class="glyphicon glyphicon-remove glyphicon-black" title="Remove this user"></span>
- </ng-template>
- </p-column>
- </p-dataTable>
+<p-table
+ [value]="users" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
+ [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)"
+>
+ <ng-template pTemplate="header">
+ <tr>
+ <th pSortableColumn="username">Username <p-sortIcon field="username"></p-sortIcon></th>
+ <th>Email</th>
+ <th>Video quota</th>
+ <th>Role</th>
+ <th pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th>
+ <th></th>
+ </tr>
+ </ng-template>