iDisplayLength causing "Cannot read property 'nTR' of undefined" error when changing page.
iDisplayLength causing "Cannot read property 'nTR' of undefined" error when changing page.
kasperskov303
Posts: 9Questions: 1Answers: 0
Hi Allan/you other guys
Im setting my iDisplayLength in my initialization of my table dynamically from a function parameter like this
[code]
function buildDatatable(length) {
oTable = $('#datatableActivities1').dataTable({
//Loads of unrelated options
"iDisplayLength": length
//more options
});
[/code]
When page is loaded and I try to change the page I get the error: Uncaught TypeError: Cannot read property 'nTr' of undefined.
Now here is the even more strange part. If I then change the length from the drop down list, the paging works fine.
This issue also occurs exactly the same way if I choose to alter the iDisplayLength with a redraw:
[code]
function buildDatatable(length) {
oTable = $('#datatableActivities1').dataTable({
//Options
});
var oSettings = oTable.fnSettings();
oSettings._iDisplayLength = length;
oTable.fnDraw();
[/code]
Any ideas? I'm using some plugins, doing callbacks and binding events the the table also. If you thing that is relevant, I get post that as well.
Im setting my iDisplayLength in my initialization of my table dynamically from a function parameter like this
[code]
function buildDatatable(length) {
oTable = $('#datatableActivities1').dataTable({
//Loads of unrelated options
"iDisplayLength": length
//more options
});
[/code]
When page is loaded and I try to change the page I get the error: Uncaught TypeError: Cannot read property 'nTr' of undefined.
Now here is the even more strange part. If I then change the length from the drop down list, the paging works fine.
This issue also occurs exactly the same way if I choose to alter the iDisplayLength with a redraw:
[code]
function buildDatatable(length) {
oTable = $('#datatableActivities1').dataTable({
//Options
});
var oSettings = oTable.fnSettings();
oSettings._iDisplayLength = length;
oTable.fnDraw();
[/code]
Any ideas? I'm using some plugins, doing callbacks and binding events the the table also. If you thing that is relevant, I get post that as well.
This discussion has been closed.
Replies
Allan
But heres a small video showing the error:
http://speedy.sh/PAUqv/iDisplayLength.avi