Problem With Fixed Column
Problem With Fixed Column
When I try to invoke Fixed Column I get an error, specifically with the following line ",
fixedColumns: true"
If I remove that part of my string, it loads fine, although it doesn't seem to be setting the column width, lol
<script type="text/javascript">
jQuery( document ).ready( function( $ ) {
var $tablesched26a = jQuery("#table-sched26a");
$tablesched26a.DataTable({
aLengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]],
scrollY: "300px",
scrollX: true,
scrollCollapse: true,
paging: false,
columnDefs: [
{ width: 20, targets: 0 }
],
fixedColumns: true
})
});
</script>
You caan find my page at the following URL;
http://www.mytownbudget.com/app/ON/Sched26a/sched_26a_UT.php?yr=2018&mun=25
here's the error I am getting;
datatables.js:94589 Uncaught TypeError: Cannot read property 'cell' of undefined
at FixedColumns._fnCopyLayout (datatables.js:94589)
at FixedColumns._fnClone (datatables.js:94819)
at FixedColumns._fnCloneLeft (datatables.js:94558)
at FixedColumns._fnDraw (datatables.js:94493)
at HTMLTableElement.<anonymous> (datatables.js:94127)
at HTMLTableElement.dispatch (jquery-1.11.3.min.js:4)
at HTMLTableElement.r.handle (jquery-1.11.3.min.js:4)
at Object.trigger (jquery-1.11.3.min.js:4)
at HTMLTableElement.<anonymous> (jquery-1.11.3.min.js:4)
at Function.each (jquery-1.11.3.min.js:2)
Any help you can offer would be greatly appreciated.
Larry
Answers
Hi Larry,
I think it is the empty
tr
in the footer that is causing the issue:Could you remove the
tfoot
completely please?Thanks,
Allan
Hi Allan,
Thanks for that tip, I removed the entire tfoot, but now get a different error
dataTables.fixedColumns.min.js:19 Uncaught FixedColumns already initialised on this table
Oddly, even with the ' fixedColumns: true' it seems that the fixed column width is in fact working. Which leads me to wonder about the purpose of the fixedColums setting though? Any ideas?
Again, thanks for your response
Larry
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
Hi, I'm facing similar issue with "fixedcolumns already initialised on this table" which is much similar to "https://datatables.net/forums/discussion/40035/uncaught-exception-fixedcolumns-already-initialised-on-this-table#latest".
Could you revert with suggested solution? Discussion was closed without specifying the resolution.
There wasn't a solution, as we've not had an example to investigate. If you're seeing it, we're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin