|
|
@@ -1,38 +1,23 @@
|
|
|
-<clr-datagrid>
|
|
|
- <clr-dg-column>Product ID</clr-dg-column>
|
|
|
- <clr-dg-column>Name</clr-dg-column>
|
|
|
- <clr-dg-column>Slug</clr-dg-column>
|
|
|
- <clr-dg-column>Description</clr-dg-column>
|
|
|
-
|
|
|
- <clr-dg-row *ngFor="let product of products$ | async" [routerLink]="['./', product.id]">
|
|
|
- <clr-dg-cell>{{ product.id }}</clr-dg-cell>
|
|
|
- <clr-dg-cell>{{ product.name }}</clr-dg-cell>
|
|
|
- <clr-dg-cell>{{ product.slug }}</clr-dg-cell>
|
|
|
- <clr-dg-cell>{{ product.description }}</clr-dg-cell>
|
|
|
- </clr-dg-row>
|
|
|
-
|
|
|
- <clr-dg-footer>
|
|
|
- <clr-dg-pagination #pagination
|
|
|
- (clrDgPageChange)="getPage($event)"
|
|
|
- [(clrDgPage)]="currentPage"
|
|
|
- [clrDgPageSize]="itemsPerPage"
|
|
|
- [clrDgTotalItems]="totalItems">
|
|
|
- <div>
|
|
|
- <div class="form-group">
|
|
|
- <div class="select">
|
|
|
- <select [(ngModel)]="itemsPerPage" (change)="getPage(currentPage)">
|
|
|
- <option [value]="10">10 per page</option>
|
|
|
- <option [value]="25">25 per page</option>
|
|
|
- <option [value]="50">50 per page</option>
|
|
|
- <option [value]="100">100 per page</option>
|
|
|
- </select>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}}
|
|
|
- of {{pagination.totalItems}} products
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </clr-dg-pagination>
|
|
|
- </clr-dg-footer>
|
|
|
-</clr-datagrid>
|
|
|
+<vdr-data-table [items]="products$ | async"
|
|
|
+ [itemsPerPage]="itemsPerPage"
|
|
|
+ [totalItems]="totalItems"
|
|
|
+ [currentPage]="currentPage"
|
|
|
+ (pageChange)="getPage($event)"
|
|
|
+ (itemsPerPageChange)="itemsPerPageChange($event)">
|
|
|
+ <vdr-dt-column>ID</vdr-dt-column>
|
|
|
+ <vdr-dt-column>Name</vdr-dt-column>
|
|
|
+ <vdr-dt-column>Slug</vdr-dt-column>
|
|
|
+ <vdr-dt-column>Description</vdr-dt-column>
|
|
|
+ <vdr-dt-column></vdr-dt-column>
|
|
|
+ <ng-template let-product="item">
|
|
|
+ <td class="left">{{ product.id }}</td>
|
|
|
+ <td class="left">{{ product.name }}</td>
|
|
|
+ <td class="left">{{ product.slug }}</td>
|
|
|
+ <td class="left">{{ product.description }}</td>
|
|
|
+ <td class="right">
|
|
|
+ <vdr-table-row-action iconShape="edit"
|
|
|
+ [linkTo]="['./', product.id]">
|
|
|
+ </vdr-table-row-action>
|
|
|
+ </td>
|
|
|
+ </ng-template>
|
|
|
+</vdr-data-table>
|