css - 具有 flex 模式的 Ngx-datatable 响应行详细信息

标签 css angular ngx-datatable

我的 ngx 数据表行详细信息有问题。 一切似乎都运行良好,所有列和行都非常灵敏。当我打开行详细信息时,它们显示正常。但是,如果我更改浏览器的宽度,细节将不会随行和列缩放。它有一个初始固定宽度,基于页面第一次加载。我似乎无法改变它。有什么建议吗?

start page

Bigger browser width

Smaller browser width

 <ngx-datatable
    #myTable
    class="material"
    [columnMode]="'flex'"
    [headerHeight]="50"
    [footerHeight]="50"
    [rowHeight]="'auto'"
    [rows]="details">
    <ngx-datatable-row-detail [rowHeight]="100" #myDetailRow (toggle)="onDetailToggle($event)" flex>
      <ng-template let-row="row" let-expanded="expanded" ngx-datatable-row-detail-template >
        <div style="padding-left:35px;">
          <div><strong>Address Address Address Address Address AddressAddressAddress Address Address Address Address Address</strong></div>
        </div>
      </ng-template>
    </ngx-datatable-row-detail>
    <ngx-datatable-column name="Name" [flexGrow]="1">
      <ng-template let-row="row" let-expanded="expanded" ngx-datatable-cell-template>
          <a
          [class.datatable-icon-right]="!expanded"
          [class.datatable-icon-down]="expanded"
          title="Expand/Collapse Row"
          (click)="toggleExpandRow(row)">aaa
        </a>
      </ng-template>
    </ngx-datatable-column>
    <ngx-datatable-column name="Name" [flexGrow]="1">
      <ng-template let-row="row" ngx-datatable-cell-template>
        testing 3
      </ng-template>
    </ngx-datatable-column>
    <ngx-datatable-column name="Gender" [flexGrow]="5">
      <ng-template let-row="row" let-value="value" ngx-datatable-cell-template>
        testing
      </ng-template>
    </ngx-datatable-column>
    <ngx-datatable-column name="Age" [flexGrow]="5">
      <ng-template let-row="row" ngx-datatable-cell-template>
        testingsecond
      </ng-template>
    </ngx-datatable-column>
  </ngx-datatable>

最佳答案

:host ::ng-deep .ngx-datatable .datatable-body .datatable-scroll {
  display: inherit;
}

在这种情况下有效

关于css - 具有 flex 模式的 Ngx-datatable 响应行详细信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51378370/

相关文章:

javascript - Angular Highcharts 颜色。除了 Highcharts.getOptions().colors[index] 之外还有什么方法可以获取颜色吗?

node.js - Node js csrf token 保护不起作用

css - Angular:嵌入,设置 SVG 元素的颜色

javascript - 将元素放在文本框上

javascript - 为 HTML5 视频 window.onscroll 设置 currentTime 滞后

css - 如何引用父对象但在 sass 中附加标签?

angular - Ngx-Datatable 访问列中的 rowIndex

angular - Ngx-datatable 行详细信息

css - Ngx-datatable 在悬停时显示图标

html - 在 div 中垂直对齐 span