Question

I have a small AngularJS app using ngTable. The app has several tables, but most of them don't need pagination. I'm working on one table that will require pagination.

When the table renders, I know there are quite a few entries in the table (more than 100). When it first renders, it shows the first 10. It draws the page size selector ("10 25 50 100") on the bottom right, but it doesn't draw the page selector on the bottom left.

I can click the buttons in the page size selector, and it will redraw showing that many entries, but it still doesn't show the page selector.

I tried examining the default pagination template, and I even defined a custom one on my page, but just pasted in the default one, so I could play with it. I added some junk content to the page size selector div, and that never showed up when it rendered, even though I can see that change in the script block in firebug.

Anyone have any ideas what's going on here?

I've managed to construct a plunkr that demonstrates this.

Was it helpful?

Solution

You need add params.total($scope.completedQueries.length); before $defer.resolve because when you init ngTableParams array $scope.completedQueries is empty, it filled when called getData

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top