“未找到匹配的记录”在表填充后 仍然存在

问题描述 投票:2回答:2

即使已加载数据,“找不到匹配的记录”行仍保留在我的表上。

remaining text

该表定义如下:

<table  datatable dt-options="gvc.dtOptions" class="table table-striped">
<thead>
<tr>
    <th data-priority="1">Alert Time</th>
    <th data-priority="2">Description</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="alert in gvc.recentAlerts">
    <td>{{alert.alert_time}}</td>
    <td>{{alert.sent_text}}</td>
</tr>
</tbody>

以及控制器中的dtOptions如下:

    self.dtOptions = DTOptionsBuilder.newOptions()
  .withDOM('t')
  .withOption('scrollY', '200px')
  .withOption('scrollCollapse', true)
  .withOption('paging', false)
  .withOption('bSort', false)
  .withOption('responsive', true);

关于它为什么要保留的任何想法?

javascript datatables angular-datatables
2个回答
2
投票

根据说明将以下代码放在src / styles.css(即您的全局样式)中]

  .dataTables_empty {
      display: none;
    } 

0
投票

如果您使用的是Anguler2或更高版本,则组件级别为SCSS或CSS(不是全局级别),

::ng-deep table.dataTable td.dataTables_empty {
            display: none;
        }
© www.soinside.com 2019 - 2024. All rights reserved.