Seemingly random apply of datatable format on different pages of the same site
Seemingly random apply of datatable format on different pages of the same site
Hi all,
I have been integrating Datatables on my site. On some pages it works fine. On others, none of the features (search, sort, ...) appear on the screen although it slightly modifies the display of the tables.
This error appears and as you can guess, I don't use a variable called nTd :
jQuery.Deferred exception: nTd is undefined _fnCreateTr@http://localhost/e-banking/JAVA/datatables.js:3118:6
_fnAddData@http://localhost/e-banking/JAVA/datatables.js:2435:4
http://localhost/e-banking/JAVA/datatables.js:2463:11
http://code.jquery.com/jquery-3.3.1.min.js:2:1324
map@http://code.jquery.com/jquery-3.3.1.min.js:2:3169
map@http://code.jquery.com/jquery-3.3.1.min.js:2:1292
_fnAddTr@http://localhost/e-banking/JAVA/datatables.js:2461:10
loadedInit@http://localhost/e-banking/JAVA/datatables.js:1293:6
http://localhost/e-banking/JAVA/datatables.js:1318:5
each@http://code.jquery.com/jquery-3.3.1.min.js:2:2571
each@http://code.jquery.com/jquery-3.3.1.min.js:2:1238
DataTable@http://localhost/e-banking/JAVA/datatables.js:881:3
$.fn.DataTable@http://localhost/e-banking/JAVA/datatables.js:15135:18
http://localhost/e-banking/JAVA/xdata.js:4:17
l@http://code.jquery.com/jquery-3.3.1.min.js:2:29373
http://code.jquery.com/jquery-3.3.1.min.js:2:29677
undefined jquery-3.3.1.min.js:2:30920
TypeError: nTd is undefined[En savoir plus]
Any chance I could get some help with this ?
Thanks a lot.
Answers
Searching the forum comes up with this thread:
https://datatables.net/forums/discussion/comment/144164/#Comment_144164
Without seeing the page its hard to say what the problem is. Make sure the number of columns in the
table
match what you have defined in Datatables. If you continue to have issues please post a link to your page or a test case replicating the issue.https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Hi Kevin,
Thanks a lot for your answer !!
It did solve the problem !!
Resolved. The number of columns was not the same as the headers. Thank you.