Proper usage of datatable-pager
See original GitHub issueI’m submitting a … (check one with “x”)
[ ] bug report => search github for a similar issue or PR before submitting
[ X ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter
Current behavior
The datatable-pager
has been exported in #1046f84, so it would be good to show a demo on how to use it…
Actually if I have a template like this:
<ngx-datatable (page)="handlePageChange($event)">
<ngx-datatable-footer>
<ng-template
let-curPage="curPage"
let-offset="offset"
let-pageSize="pageSize"
let-rowCount="rowCount"
let-selectedCount="selectedCount"
ngx-datatable-footer-template>
</ng-template>
<datatable-pager
[count]="rowCount"
[page]="curPage"
[size]="pageSize"
(change)="handlePageChange($event)">
</datatable-pager>
</ngx-datatable-footer>
<ngx-datatable>
And in component:
handlePageChange (event: any): void {
console.log(event);
}
It prints only { page: x }
instead of the whole object:
obj = {
count: x,
pageSize: x,
limit: x,
offset: x
};
Expected behavior It must return the full object on datatable-pager.
Also, since it’s exported now, shouldn’t it be renamed to ngx-datatable-pager
?
-
Table version: 9.1.0
-
Angular version: 4.0.3
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:14 (2 by maintainers)
Top Results From Across the Web
Alternative pagination - DataTables example
The default page control presented by DataTables (forward and backward buttons with up to 7 page numbers in-between) is fine for most situations,...
Read more >Pagination using Datatables - GeeksforGeeks
In this article, we will learn to implement pagination using DataTables. Other features include sorting and multiple column ordering.
Read more >Paging with Datatable - Webix
DataTable supports paging over the items in the data source. You enable and configure paging through the pager parameter. Paging doesn't depend on...
Read more >How to add datatable pager template to Angular ngx datatable
According to "pager.component.ts" - you can't custom it ('datatable-pager' component). You may try to create your own one with the similar ...
Read more >10. Add datatable in angular - YouTube
In this tutorial we will add datatable in list page, will add some packages, all the packages I will add below this section....
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
I created the pull request to export it, I only concentrated on the fact that this component is needed to make a proper custom footer 😃 .
I figured out how to use it by reading the source code. This is how I do it:
HTML:
The change handler is really important to make paging work, you have to call the onFooter event handler of your ngx-datatable which I call myTable (Mark it as a child view #myTable).
I also think it would be a good idea to rename it.
Hi
I could not manage to make a custom footer with the pager. My code
The custom footer shows but the pager is missing. Any ideas? Is there a working example somewhere?