sorting implemented
This commit is contained in:
@@ -6,48 +6,77 @@
|
||||
</div>
|
||||
|
||||
<rb-accordion>
|
||||
<rb-accordion-title><span class="rb-ic rb-ic-filter"></span> Filter</rb-accordion-title>
|
||||
<rb-accordion-title [open]="true"><span class="rb-ic rb-ic-filter"></span> Filter</rb-accordion-title>
|
||||
<rb-accordion-body>
|
||||
<form>
|
||||
<rb-form-select name="statusSelect" label="Status" [(ngModel)]="filters.status">
|
||||
<option value="validated">validated</option>
|
||||
<option value="new">new</option>
|
||||
<option value="all">all</option>
|
||||
<form (change)="loadSamples({event: $event})">
|
||||
<div class="status-selection">
|
||||
<label class="label">Status</label>
|
||||
<rb-form-checkbox name="status-validated" [(ngModel)]="filters.status.validated" [disabled]="!filters.status.new">
|
||||
validated
|
||||
</rb-form-checkbox>
|
||||
<rb-form-checkbox name="status-new" [(ngModel)]="filters.status.new" [disabled]="!filters.status.validated">
|
||||
new
|
||||
</rb-form-checkbox>
|
||||
</div>
|
||||
<rb-form-select name="pageSizeSelection" label="page size" [(ngModel)]="filters.pageSize" class="page-size-selection" #pageSizeSelection>
|
||||
<option value="10">10</option>
|
||||
<option value="25">25</option>
|
||||
<option value="50">50</option>
|
||||
<option value="100">100</option>
|
||||
<option value="250">250</option>
|
||||
<option value="500">500</option>
|
||||
</rb-form-select>
|
||||
|
||||
<button class="rb-btn rb-secondary" (click)="loadSamples()">Apply filters</button>
|
||||
<!-- <button class="rb-btn rb-secondary" (click)="loadSamples()">Apply filters</button>-->
|
||||
</form>
|
||||
</rb-accordion-body>
|
||||
</rb-accordion>
|
||||
|
||||
<ng-container *ngTemplateOutlet="paging"></ng-container>
|
||||
|
||||
<rb-table>
|
||||
<tr>
|
||||
<th>Number</th>
|
||||
<th>Material number</th>
|
||||
<th>Material name</th>
|
||||
<th>Supplier</th>
|
||||
<th>Material</th>
|
||||
<th>GF</th>
|
||||
<th>CF</th>
|
||||
<th>M</th>
|
||||
<th>type</th>
|
||||
<th>Color</th>
|
||||
<th>Batch</th>
|
||||
<th *ngFor="let key of activeKeys">
|
||||
<div class="sort-header">
|
||||
<span>{{key.name}}</span>
|
||||
<span class="rb-ic rb-ic-up" [ngClass]="{'sort-active-desc': filters.sort === key.key + '-' + 'desc'}" (click)="setSort(key.key + '-' + 'desc')"></span>
|
||||
<span class="rb-ic rb-ic-down" [ngClass]="{'sort-active-asc': filters.sort === key.key + '-' + 'asc'}" (click)="setSort(key.key + '-' + 'asc')"></span>
|
||||
</div>
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
<tr *ngFor="let sample of samples">
|
||||
<td>{{sample.number}}</td>
|
||||
<td>{{sample.material_number}}</td>
|
||||
<!-- <td>{{sample.material_number}}</td>-->
|
||||
<td>{{materials[sample.material_id].name}}</td>
|
||||
<td>{{materials[sample.material_id].supplier}}</td>
|
||||
<td>{{materials[sample.material_id].group}}</td>
|
||||
<td>{{materials[sample.material_id].glass_fiber}}</td>
|
||||
<td>{{materials[sample.material_id].carbon_fiber}}</td>
|
||||
<td>{{materials[sample.material_id].mineral}}</td>
|
||||
<!-- <td>{{materials[sample.material_id].group}}</td>-->
|
||||
<!-- <td>{{materials[sample.material_id].glass_fiber}}</td>-->
|
||||
<!-- <td>{{materials[sample.material_id].carbon_fiber}}</td>-->
|
||||
<!-- <td>{{materials[sample.material_id].mineral}}</td>-->
|
||||
<td>{{sample.type}}</td>
|
||||
<td>{{sample.color}}</td>
|
||||
<td>{{sample.batch}}</td>
|
||||
<td>{{sample.added | date}}</td>
|
||||
<td><a [routerLink]="'/samples/edit/' + sample._id"><span class="rb-ic rb-ic-edit"></span></a></td>
|
||||
</tr>
|
||||
</rb-table>
|
||||
|
||||
<ng-container *ngTemplateOutlet="paging"></ng-container>
|
||||
|
||||
<ng-template #paging>
|
||||
<div class="paging">
|
||||
<button class="rb-btn rb-link" type="button" (click)="loadPage(-1)" [disabled]="page === 1">
|
||||
<span class="rb-ic rb-ic-back-left"></span>
|
||||
</button>
|
||||
<rb-form-input label="page" (change)="loadPage({toPage: $event.target.value - page})" [ngModel]="page"></rb-form-input>
|
||||
<span>
|
||||
of {{pages()}}
|
||||
</span>
|
||||
<button class="rb-btn rb-link" type="button" (click)="loadPage(1)" [disabled]="page >= pages()">
|
||||
<span class="rb-ic rb-ic-forward-right"></span>
|
||||
</button>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user