Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to render an ngTable without the pagination decorations?

In my small AngularJS app, I render several tables using the ngTable library. Only one could use pagination. The others will always fit on less than a page. Every rendered ngTable seems to add the "10 25 50 100" selector below the table. For most of my tables, this is wasted space and is nonfunctional. How can I remove that section and get that space back?

like image 845
David M. Karr Avatar asked Mar 15 '14 16:03

David M. Karr


2 Answers

This was recently fixed (https://github.com/esvit/ng-table/issues/6) This code should do it for you (copied from same git issue):

$scope.tableParams = new ngTableParams({     count: items.length // hides pager },{     counts: [] // hides page sizes }); 
like image 182
XeroxDucati Avatar answered Sep 24 '22 00:09

XeroxDucati


Use this approach (based on this link) :

$scope.tableParams = new ngTableParams({         page: 1,   // show first page         count: 5  // count per page     }, {         counts: [], // hide page counts control         total: 1,  // value less than count hide pagination         getData: function($defer, params) {             $defer.resolve(data);         }     }); 
like image 27
Jesús Castro Avatar answered Sep 22 '22 00:09

Jesús Castro