Exception when sorting, info & pagination (aanFeatures)
Exception when sorting, info & pagination (aanFeatures)
DavideP
Posts: 4Questions: 1Answers: 0
DataTables debugger: osumeb
I've the following script:
$('#tabCriticita').DataTable({
ajax: {
url:'.........php',
dataSrc: 'data'
},
columns: [
{data: 'idCronCriticita',title:'idCronCriticita'},
{data: 'rifCriticita',title:'rifCriticita'},
{data: 'displayCrit',title:'Descrizione'},
{data: 'niceDataInizio',title:'Inizio'},
{data: 'niceDataFine',title:'Fine'},
],
"order": [[ 4, "asc" ]],
jQueryUI:true,
fixHeader:true,
"bLengthChange": false,
"bPaginate": false,
"bProcessing": true,
info:false,
scrollY: 400,
deferRender: true,
resposive: true,
"language":lang_it,
"columnDefs":[
{
"targets": [0],
"visible": false,
"searchable": false
},
{
"targets": [1],
"visible": false,
"searchable": true
}
],
"sDom": 'lfrtpF'
});
I get Uncaught TypeError: Cannot read property 'length' of undefined when i try to sorting the table.
After debugging on console, I've found out that the error is in the info function in datatables.js : aanFeatures.i is undefined (maybe because I've turned info off?)
The error disappears if I comment sDom:'lfrtpF' and info:false in my script
Can you help me?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
No one can help me?
Hi,
Are you able to give me a link to the page you are seeing this problem on so I can debug it please? I don't immediately see what the issue is from the debug code.
Allan
Hi Allan, I'm in local development now, no production site already...
After sorting or calling
new data is loaded correctly (so no json error) but i get the exception and "processing" on the table.
DataTables version: https://datatables.net/download/#jq/jszip-2.5.0,pdfmake-0.1.18,dt-1.10.8,af-2.0.0,b-1.0.0,b-colvis-1.0.0,b-flash-1.0.0,b-html5-1.0.0,b-print-1.0.0,cr-1.2.0,fc-3.1.0,fh-3.0.0,kt-2.0.0,r-1.0.7,rr-1.0.0,sc-1.3.0,se-1.0.0
As you can see in the image: http://postimg.org/image/xw8mwy3dj/
in the function info (datatable.js) aanFeatures.i is undefined, maybe because of the sDom:'lfrtpF', and the $.each fails.
Thanks for the help!
Ah - yes. Thank you for the additional info. The issue is present in Select v1.0.0 which is what you are using. It has been resolved in 1.0.1 - you can just update your include version and it should start working there.
Allan
Solved!
Thanks a lot Allan