Datatable with MVC Core Client Side Processing

Datatable with MVC Core Client Side Processing

ambabaeiambabaei Posts: 1Questions: 1Answers: 0

Hello All . i am using Datatable in MVC Core 2.2 Web application with client Side processing ( i have data less than 10,000 records ) . what i am doing now is to send a View-model from controller to View and use this model in the table DOM then a jquery will initialize the Datatable and everything works fine . i am a bit curious if working with Model in the DataTable is a good practice or not , or shall i send Data in Json format from controller to View and then load the json data in to Datatable instead ?

Answers

  • allanallan Posts: 63,213Questions: 1Answers: 10,415 Site admin

    At 10k records, personally I'd send it in JSON because you can then enable the deferRender option to speed up the initial draw time (i.e. instead of creating all 10k row nodes, the browser would just create the rows as needed for display - 10 to start with by default).

    That said, there is nothing technically wrong with your approach!

    Allan

This discussion has been closed.