How to show "Loading ..." while loading a form?

0

I have a table with more than 50 thousand records and I am showing them in a table using DataTables

How can I make a message of "Loading ..." or a load image appear while loading all the records in the table?

At the moment of loading my page starts loading all the information and this takes a while to be a large amount of data and once the process is finished, just upload the DataTables as it should look and work. / p>

Code of my table:

<table class="table table-striped table-bordered table-hover" id="dataTables-example">
                            <thead>
                                <tr>
                                    <th>Codigo</th>
                                    <th>Denominacion</th>
                                    <th>Unidad Medida</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
                                foreach ($ArrayMaterial as $Material) {
                                    echo '<tr>';
                                    echo '<td>'.$Material->CodigoMaterial.'</td>';
                                    echo '<td>'.stripslashes(utf8_encode($Material->DenominacionMaterial)).'</td>';
                                    echo '<td>'.$Material->UnidadMedidaMaterial.'</td>';
                                    echo '</tr>';
                                }
                                ?>
                            </tbody>
                        </table>

Code of the DataTable :

<script>    
    $(document).ready(function(){
        $('#dataTables-example').dataTable();
    });
</script>

Thanks!

    
asked by Alf 10.07.2018 в 18:13
source

0 answers