Jquery DataTable loading takes long time

Jquery DataTable loading takes long time

elenoraelenora Posts: 23Questions: 10Answers: 0

Hi. I'm implementing asp.net core 3.1 project and I have a Jquery DataTable in my razor view. After adding just two columns of Data and a column of checkbox, it take 4 sec long to load all the DataTable and its data. I appreciate if anyone suggests me how I can make the time of its load shorter.

Answers

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

    This section of the FAQ should help, it discusses various techniques to improve performance,

    Cheers,

    Colin

  • elenoraelenora Posts: 23Questions: 10Answers: 0

    Thank you for your reply. As I understand, due to having a lots of records displaying in DataTable, I should use some code like the following for my DataTable. $('#example').dataTable( {
    "serverSide": true,
    "ajax": "xhr.php"
    } );
    However, I'm passing data from controller to view by a model that was read from SQL server DataBase. So how can I use ajax to load the data into DataTable.

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

    For server side processing, enable serverSide. The protocol is discussed here. Also see examples here.

    Cheers,

    Colin

This discussion has been closed.