Datatable is recreating itself after no records are returned.
Datatable is recreating itself after no records are returned.
I have a datatable using ajax sourced data. I have 2 filters above my table to display 'draft' and 'published' records in the table. draft filter works by adding new params to the to the table with $table.data('dt_params', additional_params ); then inside the controller i do my filter and its no problem. My problem is that when I sort by published it returns no records (which is correct) and then I see another XHR firing after that draw where the draw count is set back to 0 and the table is remade and populated with the default sort. Why is this happening? I can confirm I am only calling the controller ajax response once (no double bindings or anything like that) and I can confirm that draw is happening twice (first for the draw i want, and then a second unwanted time that rebuilds the table). Thanks! Any insight would be really helpful - can provide code and screenshots if needed