Newer
Older
<accordion-group (isOpenChange)="initDatatable()" #ag [panelClass]="'custom-accordion'" class="my-2">
<button class="btn btn-link btn-block clearfix" accordion-heading>
<div class="pull-left float-left">
Datatable
<span *ngIf="ag.isOpen"><i class="fas fa-chevron-up"></i></span>
<span *ngIf="!ag.isOpen"><i class="fas fa-chevron-down"></i></span>
</div>
</button>
<div *ngIf="!searchMeta" class="text-center">
<i class="fas fa-circle-notch fa-spin fa-3x"></i>
<span class="sr-only">Loading...</span>
</div>
<table class="table table-striped table-bordered">
<th *ngFor="let attribute of searchMeta.attributes_selected" scope="col">
{{ attribute.label }}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let datum of searchData">
<td *ngFor="let attribute of searchMeta.attributes_selected">
<div *ngIf="datum[attribute.label]" [ngSwitch]="getAttributeRenderer(attribute.name)">
<app-img [src]="getAttributeUriAction(attribute.name, datum[attribute.label])">
</app-img>
<app-thumbnail [attributeName]="attribute.name"
[src]="getAttributeUriAction(attribute.name, datum[attribute.label])">
</app-thumbnail>
<app-link [href]="getAttributeUriAction(attribute.name, datum[attribute.label])"
[data]="datum[attribute.name]"></app-link>
<app-btn [href]="getAttributeUriAction(attribute.name, datum[attribute.label])"
[data]="datum[attribute.name]"></app-btn>
<app-detail-link [datasetName]="datasetName" [data]="datum[attribute.label]">
</app-detail-link>
<app-detail-btn [datasetName]="datasetName" [data]="datum[attribute.label]">
</app-detail-btn>
<app-download
[href]="getAttributeUriAction(attribute.name, datum[attribute.label])">
</app-download>
<div *ngSwitchCase="'json'" class="text-center">
<app-json-renderer [attributeName]="attribute.name"
[json]="datum[attribute.label]">
</app-json-renderer>
<pagination [totalItems]="searchMeta.total_items" [boundaryLinks]="true" [rotate]="true" [maxSize]="5"
(pageChanged)="getSearchData.emit($event.page)"></pagination>