How to display 1 million rows using bootstrap-table.js

1

I am showing a table using Bootstrap-table.js, with 10000 records it works but when I try to show more records (1 million), it tries to load and at the end it ends and it does not show.

The table has the following options defined:

 data-toolbar="#toolbar"
 data-url="http://localhost/proyecto/dame_registros"
 data-search='true'
 data-toggle='mi-tabla'
 data-show-toggle='true'
 data-show-columns='true'
 data-show-refresh='true'
 data-show-pagination-switch='true'
 data-pagination='true'
 data-page-list='[5, 10, 20, ALL]'
 data-sort-name='received'
 data-sort-order='desc'

And the call in the js file is as follows:

$('#mi-tabla').bootstrapTable({
    columns: [
            {
                field: 'id',
                title: 'ID',
                align: 'center',
                valign: 'middle'
            },
            {
                field: 'received',
                title: 'Received',
                align: 'center',
                sortable: true,
                valign: 'middle'
            },
            {
                field: 'firstname',
                title: 'Firstname',
                align: 'center',
                valign: 'middle'
            },
            {
                field: 'lastname',
                title: 'Lastname',
                align: 'center',
                valign: 'middle'
            }
    ]
});

I am attentive to any idea, solution or suggestion.

    
asked by Tony 12.04.2017 в 22:06
source

2 answers

0

Even a million records is too much, it will consume too much memory in the browser and it will surely end by not rendering. If you save that information in a text file you can realize the weight, if we talk that it can weigh up to 1 GB the notepad will not be able to open it.

It will always be better to paginate on the server when it comes to a high number of records.

    
answered by 12.04.2017 в 22:31
0

The main idea of Bootstrap is to have a homogeneous presentation in devices of different sizes. Trying to show a table of 10,000 records using Bootstrap with paging on the client already seems extreme, do not say 1,000,000 records.

The best thing in any case is to try to minimize the amount of records that must be loaded in the client, either through filtering or paging on the server.

    
answered by 12.04.2017 в 22:37