Fixed Header The Only Attribute Not Initializing
Fixed Header The Only Attribute Not Initializing
hickmanjos
Posts: 5Questions: 2Answers: 0
I'm having issues getting the Fixed Header extension to actually go into effect when setting up the table.
The DataTables debugger is showing I have it installed, below is how I have initialized the table.
jQuery(document).ready(function() {
var table =
jQuery('#reports').dataTable({
"bFilter": true,
"bInfo": false,
"bPaginate": false
});
$.fn.dataTable.FixedHeader( table );
});
And my includes(Laravel Blade Syntax):
{{ HTML::script('js/jquery.dataTables.min.js'); }}
{{ HTML::script('js/dataTables.fixedHeader.js'); }}
The options I have enabled/disabled are showing so I'm assuming it's simply how I'm trying to initialize the extension.
Any sort of help in the right direction would be awesome!
This discussion has been closed.
Answers
new $.fn.dataTable.FixedHeader( table );
^^^
I can't believe I forgot the new! Though even after adding it, it still isn't bringing the header along.
UPDATE: I'm getting an error while checking in the Chrome Dev Tools of
Uncaught TypeError: Cannot read property 'fn' of undefined
UPDATE 2: Just adding what my init function looks like now.
Got it working!
Adding the
new
and changing the last variable definition of$
tojQuery
and it works. Now I just have to tinker with the width and the styling to get the headers to match now. (New Issue)Thanks for the help, tangerine!