Table taking long time to update

Table taking long time to update

saurabhjain07saurabhjain07 Posts: 3Questions: 1Answers: 0

I am getting the data from Mongo DB of 12000 rows and displaying on my frontend. The mongo query works fast by loading the data in table takes time say half to 1 minute.

This question has an accepted answers - jump to answer

Answers

  • saurabhjain07saurabhjain07 Posts: 3Questions: 1Answers: 0
    edited August 2018

    This is the html i am using to display and loop through the data

    {% for entry in dump %}
    Server(FQDN) OS Platform
    {{ entry.SERVER }} {{ entry.OS }} {{ entry.Platform }} {{ entry.DC }} {% endfor %}
  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947

    Does this have anything to do with Datatables?

    Kevin

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    Looping and adding rows will be slow. This page of the FAQ offers some suggestions.

    C

  • saurabhjain07saurabhjain07 Posts: 3Questions: 1Answers: 0

    I am using the datatable like below.

    $(document).ready(function() {
    $('#example').DataTable( {
    "orderClasses": false,
    language: {"sLengthMenu": "Show : MENU Export as :" },
    dom: 'lBfrtip',
    buttons: [
    'csv', 'excel',
    ],
    "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],

    } );
    $('.dt-button').removeClass().addClass('btn btn-sm');
    

    } );

This discussion has been closed.