Closed char101 closed 10 years ago
Can you link to a test case showing the issue please. I don't immediately see anything wrong, but there obviously is something somewhere, so I'd need to dig deeper.
This is enough to reproduce the error
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
</head>
<body>
<table id="t1">
<thead>
<tr><th>Header</th></tr>
</thead>
<tbody>
<tr><td>Body</td></tr>
</tbody>
</table>
<script src="https://github.com/DataTables/DataTables/raw/master/media/js/jquery.js"></script>
<script src="https://github.com/DataTables/DataTables/raw/master/media/js/jquery.dataTables.js"></script>
<script src="https://github.com/DataTables/FixedHeader/raw/master/js/dataTables.fixedHeader.js"></script>
<script>
new FixedHeader(document.getElementById('t1'));
</script>
</body>
</html>
I believe the problem is that
new $.fn.dataTable.Api( mTable ).settings()
is an empty array, but I could not trace to where settings()
is defined, so I can't find the cause.
Ah I see - sorry, I had missed the fact that you were using FixedHeader without DataTables. That is no longer supported in the latest major release of FixedHeader. From the release notes:
Removed: Removed the ability to operate on a plain HTML table - this is specific a DataTables extension now
It probably is possible to modify FixedHeader to operate without DataTables again, but it wasn't something I wanted to support myself.
I see, I was reading the comment in the source code
* Inputs: mixed:mTable - target table
* 1. DataTable object - when using FixedHeader with DataTables, or
* 2. HTML table node - when using FixedHeader without DataTables
so I thought that it was still supported.
That's the bug!
Sorry about that. The FixedHeader (and the extensions for DataTables generally) badly need to have their documentation updated in the same way DataTables is currently getting. That's the long term goal for this year...
Thanks for the explanation (and fix) :thumbsup:
Hi,
I was using this code to initialize FixedHeader
And got that error, which comes from these lines
I was using datatable and fixedheader from the master branch.
Is my initialization code wrong or is this a bug?