-
Notifications
You must be signed in to change notification settings - Fork 851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can someone post an exmple of a pagination footer template with all the buttons #1026
Comments
Same, i would like an example.. I'm looking to put the pagination-footer in a panel-footer (BS3) and have no idea how to do this :/ |
Hi @jbeaudoin11 , Between the time I posted this yesterday and today I totally got it. I added some comments there so it can be used by others. Please let me know if I can help you. Its actually pretty easy.
|
How do I tell ngTables to use this template? |
@Matias-Barrios thanks! I did figure it out shortly after i asked but I am glad you replied. I am having a different issue. The pagination links do not do anything. Calls to params.page(page) dont do anything nor raise an error or anything. I even tried doing my own function for ng-click but because it's an ng-repeat, i think, it is in a different scope and wont call my custom functions. Do you know of any possible causes of this behavior? And/or do you know how to make the template use a custom function in $scope or defined in my controller. |
@tvl83 no problem buddy. I don't know why it would not work for you. This footer template has worked for me with no issues. Are you sure you have data? (Not only one single page ) Are you doing some custom filtering? Are you sure your version of ng-table is same? If you follow the link I gave you you can actually find ng-table module somewhere and you might check the version there |
Yes I know I have data, it's paginated from the api and there are 45000 records of which I get 10 or 25 at a time. I do filtering, yes but at one time the pagination worked perfectly fine. I am using the getData parameter when initializing NgTableParams and I have a feeling that has something to do with it. I am console loging params.page() within that function and it always ever says 1 even when I click on the button to go to another page. I found a template and hard coded params.page(2) (when i know that there are 2 pages of data) and it still does nothing from the custom template. Even a custom function I define in the controller
vm is an alias of Neither of these versions of the functions work. Nothing gets printed to the console. It seems to have something to do with the getData. Looking at the API docs http://ng-table.com/api-docs/classes/ngtableparams.html#page passing a number to params.page(number) will
I put the next and previous buttons outside of the template and it fires fine. When running this I am sending 2 to page() but when i print params.page() in getData it's still 1. I am going to, in the goPageNext, function set a different variable to the next page number and then in getData set the params.page() to that variable. It seems like a very convoluted way to do it but that should work. Just did this and it works perfect as I thought it would. I am just very confused as to why it does not work properly. It seems I have to roll my own, outside of the template, per page buttons. it defaults to 10 and i can click 25, then 50 and then 100 and it changes. If I try to go down to 10 again i have to click the current perpage amount I am on then click the lower amount to have it actually change. Very strange. |
Hi, I need to write a custom footer for my table, but on the few examples I have seen by browsing through different forums I can see only examples with a next and previous buttons. I would like to have one with all the buttons, including the one which direct to individual pages.
Could someone help on this?
BTW - This information does not exist on the ng-table examples here : http://ng-table.com/#/demo/todo
The text was updated successfully, but these errors were encountered: