Disable DataTables procesing on large datasets
Disable DataTables procesing on large datasets
owanneke
Posts: 3Questions: 0Answers: 0
I deployed DataTables on an existing application with hundreds of reports and pages.
These pages use different datasources and inputs, so switching all of them to server side rendering takes (a lot of) time.
Is it possible to use iTotalRecords to "disable" DataTables if it exceeds a certain value and just render the table as it's source HTML, without the DataTables options on them until I can change the page to using ssr?
I cannot add an example as it's an internal application with confidential data, yet for the concept of the question I don't think it's mandatory?
These pages use different datasources and inputs, so switching all of them to server side rendering takes (a lot of) time.
Is it possible to use iTotalRecords to "disable" DataTables if it exceeds a certain value and just render the table as it's source HTML, without the DataTables options on them until I can change the page to using ssr?
I cannot add an example as it's an internal application with confidential data, yet for the concept of the question I don't think it's mandatory?
This discussion has been closed.
Replies
If you want to not initialise DataTables on large HTML tables you could do something trivial like:
[code]
if ( $('#myTable tbody tr').length < 1000 ) {
$('#myTable').dataTable();
}
[/code]
Allan