i am working on pagination and i am using DataTables plugin , on some tables it\'s work but on some tables it gives error:
Uncaught TypeError: Cannot
I faced same issue and later found a typing mistake in "targets" property under columnDefs. See below example,
WRONG code below,
{
"name": "firstName",
"target": [1],
"visible": false
}
Correction - missed 's' in targets :(
{
"name": "firstName",
"targets": [1],
"visible": false
}
Looks like this error occurs when something causing columns not getting initialized. I checked that event 'preInit.dt' is not fired in this case.
Hope this helps someone.