2.1.3 BUG: Pagination Breaks When Trying to Hide Disabled Paging Buttons

2.1.3 BUG: Pagination Breaks When Trying to Hide Disabled Paging Buttons

SickPuPSickPuP Posts: 13Questions: 6Answers: 0

https://jsfiddle.net/ddelella/0jaoqhg5/2/

When I display the pager I prefer to hide the disabled buttons. Up through version 2.0.8 this was achieved via a single script to target the li.dt-paging-button.disabled selector. However, in 2.1.3 this seems to trigger some bug behind the scenes and only the first page and next arrow are showing. The rest appear if you go to the next page. When inspecting the code, the second and third page buttons do not contain the disabled class. I am not sure why this is happening.

You can recreate this in the jsfiddle above by removing the style and the pager will work as expected.

Answers

  • allanallan Posts: 63,441Questions: 1Answers: 10,465 Site admin

    Try:

    li.dt-paging-button.disabled {
      visibility: hidden;
    }
    

    https://jsfiddle.net/8bxpacn6/

    I think the use of display: none is messing with the responsive calculations and confusing the code as it was never designed to handle such a case.

    Regards,
    Allan

Sign In or Register to comment.