2017-08-17 28 views
2

角度jsを初めて使用しています。 私はAPIからのデータの一覧表を持つプロジェクトに取り組んでいます。このため、私はlibraryを使用しています。 正常に動作します。しかし、25のエントリがあり、10に制限を設定し、3行目のページに移動すると、5行が空の10行のテーブルが表示されます。 空の行を削除します。助けてください。参考のためにスクリーンショットを取り付けデータテーブルの空白行を削除する

myclass.html

<div style="margin: auto; max-width: 1000px; margin-bottom: 50px;"> 
    <data-table id="persons-grid" 
     headerTitle="Employees" 
     [items]="items" 
     [itemCount]="itemCount" 
     (reload)="reloadItems($event)" 

     (rowClick)="rowClick($event)" 
     (rowDoubleClick)="rowDoubleClick($event)" 
     [rowTooltip]="rowTooltip" 
     > 
     <data-table-column 
      [property]="'name'" 
      [header]="'Name'" 
      [sortable]="true" 
      [resizable]="true"> 
     </data-table-column> 
     <data-table-column 
      [property]="'date'" 
      [header]="'Date'" 
      [sortable]="true"> 
      <template #dataTableCell let-item="item"> 
       <span>{{item.date | date:'yyyy-MM-dd'}}</span> 
      </template> 
     </data-table-column> 
     <data-table-column 
      property="phoneNumber" 
      header="Phone number" 
      width="150px"> 
     </data-table-column> 
     <data-table-column 
      [property]="'jobTitle'" 
      [header]="'Job title'" 
      [visible]="false"> 
     </data-table-column> 
     <data-table-column 
      [property]="'active'" 
      [header]="'Active'" 
      [width]="100" 
      [resizable]="true"> 
      <template #dataTableHeader let-item="item"> 
       <span style="color: rgb(232, 0, 0)">Active</span> 
      </template> 
      <template #dataTableCell let-item="item"> 
       <span style="color: grey"> 
       <span class="glyphicon glyphicon-ok" *ngIf="item.active"></span> 
       <span class="glyphicon glyphicon-remove" *ngIf="!item.active"></span> 
       </span> 
      </template> 
     </data-table-column> 
    </data-table> 
</div> 

enter image description here

+0

問題の[plunker](https://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5?p=catalogue)を作成できますか? –

+0

タグに[substituteRows] = "false"を追加して問題が解決するかどうかをお知らせください。 –

+0

@vikkはいそれが動作します。返信いただきありがとうございます。 – nikhila

答えて

3

問題を解決しますtag.Itに [substituteRows]="false"

を追加します。

関連する問題