Angular + Datatables all entries by default diaplayed
See original GitHub issueI’m submitting a…
[ ] Bug report
[ ] Feature request
[ ] Documentation issue or request
[x ] Question
Current behavior
I am using angular+datatables to diplay some jason data from REST API server. Simple. I have a angular service that fetches data from server, returning Observable. Then I subscribe to Observable and receive data in json array. In component template I am using *ngFor directive to display data in html table. Simple. Everything work fine expect that all entries are displayed by default, but it should be only 10 (pageLenght: 10)
<table datatable [dtOptions]="dtOptions" [dtTrigger]="dtTrigger" class="row-border hover compact order-column">
<thead>
<tr>
<th>Broj lokala</th>
<th>Korisnik</th>
<th>Funkcija</th>
<th>Sektor/Pogon</th>
<th>Služba</th>
<th>Klasa biranja</th>
</tr>
</thead>
<tbody>
<tr *ngFor = "let ext of extensions">
<td>{{ext.extension_num}}</td>
<td>{{ext.customer_name}}</td>
<td>{{ext.work_position}}</td>
<td>{{ext.sub_department}}</td>
<td>{{ext.department}}</td>
<td>{{ext.dialing_class}}</td>
</tr>
</tbody>
<tfoot>
<th>Broj lokala</th>
<th>Korisnik</th>
<th>Funkcija</th>
<th>Sektor/Pogon</th>
<th>Služba</th>
<th>Klasa biranja</th>
</tfoot>
Expected behavior
To display first 10 entries
Minimal reproduction of the problem with instructions
Environment
- node version:
- angular version: 6
- angular-cli version: 6.0.8
- jquery version:
- datatables version:
- angular-datatables version:
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
How to show all rows by default in JQuery DataTable
I have tried this code, but it only shows 10 rows by default. $("#adminProducts").dataTable({ "aLengthMenu": [100] });.
Read more >dataTables shows all rows by default
Hi, I am using dataTables with following settings. ... On reload of my page, I expected it to first show me only one...
Read more >Page length options - DataTables example
Name Position Office Age Start date Salary
Airi Satou Accountant Tokyo 33 2008‑11‑28 $162,700
Angelica Ramos Chief Executive Officer (CEO) London 47 2009‑10‑09 $1,200,000
Ashton Cox...
Read more >Options - DataTables
dataTable.defaults object. This object takes all of the same parameters as the DataTables initialisation object, but in this case you are setting the ......
Read more >Setting defaults - DataTables example
This example shows the searching and ordering features of DataTables being disabled by default, which is reflected in the table when it is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can you provide the typescript code?
@ng-model, your issue looks like you forgot to use the
dtTrigger
, so the HTML is rendered with angular, but DataTable does not know the content.This issue has been closed due to inactivity. Please feel free to re-open the issue to add new inputs.