mercredi 21 novembre 2018

DataTable paging by tbody instead of tr elements

I have problem with slow loading of page with table of many rows. So I decided to make a pagination and that way make it a little bit faster. But, my rows are created from tbody elements where each tbody element includes 2 tr elems.

Here is example:

<table id="mydatatable" class="table table-striped jambo_table bulk_action" style="table-layout: fixed;">
<thead>
    <tr>
        <th>A</th>
        <th>B</th>
        <th>C</th>
    </tr>
</thead>
<tbody>
    <tr>
        <td>1</td>
        <td>2</td>
        <td>3</td>
    </tr>
    <tr>
        <td colspan='3'>
            <div>BIG CONTENT</div>
        </td>
    </tr>
</tbody>
<tbody>
    <tr>
        <td>1</td>
        <td>2</td>
        <td>3</td>
    </tr>
    <tr>
        <td colspan='3'>
            <div>BIG CONTENT</div>
        </td>
    </tr>
</tbody>

On the mydatable ID I'm calling .DataTable() function to make a sorting of rows and pagination. Sorting is fully working but there is problem with pagination, which is absolutely not working :D

Can someone help me solve this problem somehow?

Thank you.

F.




Aucun commentaire:

Enregistrer un commentaire