Setting bStateSave to true = asSorting error
Setting bStateSave to true = asSorting error
Hi,
We have been using an older version (v. 1.7.6) of DataTables for a while and now we want to upgrade to the newest version (v. 1.9.4).
It all works great except that if we turn on bStateSave on we get this error:
[code]Uncaught TypeError: Cannot read property 'asSorting' of undefined jquery.dataTables.min.js:5953
_that jquery.dataTables.min.js:5953
p.extend.each jquery.js:2
p.fn.p.each jquery.js:2
DataTable jquery.dataTables.min.js:5652
DataTable.LoadTable datatable.js:105
jQuery.ajax.success datatable.js:62
p.Callbacks.k jquery.js:2
p.Callbacks.l.fireWith jquery.js:2
y jquery.js:2
p.support.ajax.p.ajaxTransport.send.d[/code]
Turning bStateSave off again makes the error go away.
We are initializing the DataTables like this:
[code]
jQuery(_target).dataTable({
"bStateSave": true,
});
[/code]
Unfortunally i can not link to an example page because the system runs on the intranet.
Any ideas on how to fix this?
We have been using an older version (v. 1.7.6) of DataTables for a while and now we want to upgrade to the newest version (v. 1.9.4).
It all works great except that if we turn on bStateSave on we get this error:
[code]Uncaught TypeError: Cannot read property 'asSorting' of undefined jquery.dataTables.min.js:5953
_that jquery.dataTables.min.js:5953
p.extend.each jquery.js:2
p.fn.p.each jquery.js:2
DataTable jquery.dataTables.min.js:5652
DataTable.LoadTable datatable.js:105
jQuery.ajax.success datatable.js:62
p.Callbacks.k jquery.js:2
p.Callbacks.l.fireWith jquery.js:2
y jquery.js:2
p.support.ajax.p.ajaxTransport.send.d[/code]
Turning bStateSave off again makes the error go away.
We are initializing the DataTables like this:
[code]
jQuery(_target).dataTable({
"bStateSave": true,
});
[/code]
Unfortunally i can not link to an example page because the system runs on the intranet.
Any ideas on how to fix this?
This discussion has been closed.
Replies
As the 'new thread' information says:
> Do: Use DataTables live or JS Fiddle if you can't link to your own page.
Allan
Thank you for your reply. I have put together an example here:
http://188.120.94.188/tvisinfotest/datatabletest.asp
First time you load the page it properly won't fail, but then try to do some bStateSave stuff like changing the number of rows to show and then reload the page. This will give you the error described in topic.
Looking forward to your reply on this.
I'd really suggest stripping back the page to simplify the issue - there is a huge amount of Javascript on that page and it is possible there is a conflict somewhere. And even if not, it will simplify hugely.
Allan
I simplified the page back to the simplest possible, but i still get the error. I have updated the test paged that i linked to above, if you could take a look again?
Now the DataTables is initialised directly at the linked page and isn't encapsulated.