So I get a console error on a large set of rows that I\'m iterating from a database with php. I am initializing this with the metronic theme. As you can see I have my thead and
Number of items in array specified by columns option should match number of From the manual: Note that if you use Add extra object to Alternatively you can replace See jQuery DataTables: Common JavaScript console errors for more information on this and other common console errors. elements. You have 12 elements in columns array and 13 elements.
columns
to define your columns, you must have an entry in the array for every single column that you have in your table (these can be null
if you don't which to specify any options).SOLUTION
columns
array to match number of columns in the HTML.columns
with columnDefs
entirely for readability."columnDefs": [{
"orderable": false,
"searchable": false,
"targets": [0]
}, {
"orderable": false,
"targets": [2, 3, 11, 12]
}
],
LINKS