On 1st DataTable Render, Empty Message (“No Data”) Has Colspan = 0 (Subsequent Renders OK)

On 1st DataTable Render, Empty Message (“No Data”) Has Colspan = 0 (Subsequent Renders OK)

Eugene_BEugene_B Posts: 19Questions: 8Answers: 0

I am using: DataTables 1.10.11

I have a Search button on the form that destroys and re-initializes a DataTable to display the results of the latest search. This works fine.

_$('#resultsTable').DataTable().destroy();
$('#resultsTable').DataTable( { ... } );
_
The 1st time I search after coming onto the page, if there are no results, the Empty message is **colspan=0 **and not displayed correctly.

But on all subsequent Searches, for the same no-data empty result, it correctly becomes colspan=N which is the number of columns (in my case 8).

Why is the initial colspan for an empty result incorrect?

Replies

This discussion has been closed.