Skip to content
Snippets Groups Projects
datatable.component.html 1.54 KiB
Newer Older
  • Learn to ignore specific revisions
  • François Agneray's avatar
    François Agneray committed
    <accordion>
    
    François Agneray's avatar
    François Agneray committed
        <accordion-group (isOpenChange)="initDatatable()" #ag [panelClass]="'custom-accordion'" class="my-2">
    
    François Agneray's avatar
    François Agneray committed
            <button class="btn btn-link btn-block clearfix" accordion-heading>
                <div class="pull-left float-left">
                    Datatable
                    &nbsp;
                    <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">
    
    François Agneray's avatar
    François Agneray committed
                <div class="table-responsive">
    
    François Agneray's avatar
    François Agneray committed
                    <table class="table table-striped">
                        <thead>
                            <tr>
                                <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" [innerHTML]="datum[attribute.name]"></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
    
    François Agneray's avatar
    François Agneray committed
                <div class="mt-3">
                    <p>Total items {{searchMeta.total_items}}</p>
                </div>
                <div class="mt-3">
                    <pagination [totalItems]="searchMeta.total_items" [boundaryLinks]="true" [rotate]="true" [maxSize]="5" (pageChanged)="getSearchData.emit($event.page)"></pagination>
                </div>
    
    François Agneray's avatar
    François Agneray committed
            </div>
        </accordion-group>
    </accordion>