简体   繁体   中英

ngx-datatable column header tooltip gets cut off

<ngx-datatable-column [width]="24"
                                  [sortable]="true"
                                  [canAutoResize]="false"
                                  [draggable]="false"
                                  [resizeable]="false"
                                  [headerCheckboxable]="true"
                                  [checkboxable]="true">
            </ngx-datatable-column>
            <ngx-datatable-column name='Name' prop='formattedStudentName' [width]="400" [cellClass]="'se-list-item'">
                <ng-template let-column="column" ngx-datatable-header-template>
                    <ng-container>
                        <div ngbTooltip="Click on the word 'Name' to change the sort direction of the student list">
                            {{column.name}}
                        </div>
                    </ng-container>
                </ng-template>
                <ng-template let-value="value" let-row="row" ngx-datatable-cell-template>
                    <div>
                        <a href="#" (click)="!!onNameClicked(row)">{{value}}</a>
                    </div>
                </ng-template>
                </ngx-datatable-column>

This is part of my code. I needed to use a ngbTooltip, which works, for the column header, but when I hover the bubble gets cut off by the datatable. How can I prevent it from getting cutoff?

<ngx-datatable-column name='Name' prop='formattedStudentName' [width]="400" [cellClass]="'se-list-item'">
            <ng-template let-column="column" ngx-datatable-header-template>
                <ng-container>
                    <div container="body" ngbTooltip="Click on the word 'Name' to change the sort 
direction of the student list">
                        {{column.name}}
                    </div>
                </ng-container>
            </ng-template>
            <ng-template let-value="value" let-row="row" ngx-datatable-cell-template>
                <div>
                    <a href="#" (click)="!!onNameClicked(row)">{{value}}</a>
                </div>
            </ng-template>
            </ngx-datatable-column>

By adding container="body" to the div with the tooltip it allowed the tooltip window to pop over the borders of the ngx-datatable.

Side note: in my research I found that for ngbTooltip you can add tooltipClass="className" to customize the tooltip window.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM