Home How to re-order the angularjs ngTable pagination?
Reply: 0

How to re-order the angularjs ngTable pagination?

user1333
1#
user1333 Published in May 23, 2018, 10:41 pm

I'm using angularjs 1.5.7 in my current project. I use ngTable almost everywhere in this project. Lately I've been asked to change the way we show pagination on top of each table. Our current format:

We want to have:

Here is my code snippet:

<ul class="pagination">
    <li ng-class="{'disabled': !page.active}" ng-repeat="page in pages" ng-switch="page.type">
        <a ng-switch-when="first" ng-click="params.page(page.number)" href="" translate>TABLE.FIRST</a>
        <a ng-switch-when="prev" ng-click="params.page(page.number)" href="" translate>TABLE.PREVIOUS</a>
        <a ng-switch-when="next" ng-click="params.page(page.number)" href="" translate>TABLE.NEXT</a>
        <a ng-switch-when="last" ng-click="params.page(page.number)" href="" translate>TABLE.LAST</a>
    </li>

    <li ng-if="params.pages < 2" ng-class="{'disabled':true}" ng-repeat="n in ['«','1','»']">
        <a type="button" ng-click="" href="" ng-bind="n"></a>
    </li>
</ul>

Unfortunately, I can't get it in order of: First>Prev>Next>Last. What I get instead is:

I was wondering if there is a way to force it to appear in the order I want?

Thanks

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.302862 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO