tibas
tibas

Reputation: 199

DataTable limited rows

I have data in my SQLite table and it has 985 rows, so I used DataTable to organise (searching and export to Pdf, CSV...), the problem is that the DataTable is limited rows and just shows the first 200 rows!.

my code is

<script>
    $(document).ready( function () {
          $('#table_id').DataTable({
    dom: 'B<"clear">lfrtip',
    buttons: {
        name: 'primary',
        buttons: [ 'copy', 'csv', 'excel', 'pdf' ]
        }
      });
});
</script

the data is stored in table Sqlite

enter image description here

and in the HTML page:

enter image description here

so what's the solution with?

Upvotes: 0

Views: 343

Answers (1)

BeerusDev
BeerusDev

Reputation: 1509

There is more than one option for this:

You can use the paging option and set it to false, or you can use the pageLength option to choose how many results you want to show on one page.

paging:

<script>
    $(document).ready( function () {
          $('#table_id').DataTable({
    dom: 'B<"clear">lfrtip',
    paging: false,
    buttons: {
        name: 'primary',
        buttons: [ 'copy', 'csv', 'excel', 'pdf' ]
        }
      });
});
</script

pageLength:

<script>
    $(document).ready( function () {
          $('#table_id').DataTable({
    "pageLength": 1000,
    dom: 'B<"clear">lfrtip',
    buttons: {
        name: 'primary',
        buttons: [ 'copy', 'csv', 'excel', 'pdf' ]
        }
      });
});
</script

Upvotes: 1

Related Questions