DataTable pagination with Bootstrap v4.0.0-alpha.2

DataTable pagination with Bootstrap v4.0.0-alpha.2

arunkumar90arunkumar90 Posts: 4Questions: 3Answers: 0
edited January 2016 in Free community support

Hi i am using data tables with Bootstrap v4.0.0-alpha.2 version in latest version bootstrap pagination class have changed to

<ul class="pagination">
    <li class="page-item">
      <a class="page-link" href="#" aria-label="Previous">
        <span aria-hidden="true">&laquo;</span>
        <span class="sr-only">Previous</span>
      </a>
    </li>
    <li class="page-item"><a class="page-link" href="#">1</a></li>
    <li class="page-item"><a class="page-link" href="#">2</a></li>
</ul>

Looks like

<ul class="pagination">
    <li class="page-item">
      <a class="page-link" href="#" aria-label="Previous">
        <span aria-hidden="true">&laquo;</span>
        <span class="sr-only">Previous</span>
      </a>
    </li>
    <li class="page-item"><a class="page-link" href="#">1</a></li>
    <li class="page-item"><a class="page-link" href="#">2</a></li>
</ul>

how can override current data table behavior to to make it work normally with newer version?

fixed in javascript

$('ul.pagination li').addClass('page-item');
$('ul.pagination li a').addClass('page-link').

is this right approach ?

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Answers

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin

    For the moment yes, that probably is the correct approach.

    I'll look into addressing Bootstrap 4 compatibility for the next release of DataTables.

    Allan

This discussion has been closed.