Problem with uninitialized col.bVisible in jquery.dataTables.js
Problem with uninitialized col.bVisible in jquery.dataTables.js
I'm hoping that someone can help me with this. I looked through the forum but could not find a reference to the exact problem.
I using DataTables version 1.10.11 and Buttons 1.1.2 and trying to use the column groups example listed here:
https://datatables.net/extensions/buttons/examples/column_visibility/columnGroups.html
and I downloaded all of the JS and CSS used in the examples, but I keep getting this error:
Uncaught TypeError: Cannot read property 'bVisible' of undefined__setColumnVis
@ jquery.dataTables.js:8427(anonymous function)
@ jquery.dataTables.js:8531$.extend.iterator
@ jquery.dataTables.js:6972(anonymous function)
@ jquery.dataTables.js:8527(anonymous function)
@ jquery.dataTables.js:7105$.extend.colvisGroup.action
@ buttons.colVis.js:185action
@ dataTables.buttons.js:574(anonymous function)
@ dataTables.buttons.js:589jQuery.event.dispatch
@ jquery-2.2.0.js:4732elemData.handle
@ jquery-2.2.0.js:4544
When I look at the line in jquery.dataTables.js, it looks like this:
// Set
// No change
if ( col.bVisible === vis ) {
return;
}
any ideas?
Answers
here is a snippet of my JS code:
...
$(document).ready(function() {
...
I figured out what I was doing wrong. I was using "1" as the first column index instead of "0". That seemed to clear up the problem.