Getting all filtered rows in the table failing in 1.10
Getting all filtered rows in the table failing in 1.10
cockatiel
Posts: 3Questions: 1Answers: 0
In DT 1.9.4, I could use myTable._('tr', {filter:'applied'});
without any issue. However, since upgrading to 1.10, the exact same code gives me the error: Uncaught TypeError: Cannot read property 'nodeType' of null
.
In 1.10 have also tried the new method myTable.rows( { filter: 'applied' } ).data().toArray();
. However, that then gives me the error Uncaught TypeError: undefined is not a function
Any clues as to what may be causing this?
Thanks!
This discussion has been closed.
Answers
Using the
_
method: http://live.datatables.net/nexakis/2/editUsing the
rows().data()
method: http://live.datatables.net/nexakis/1/editBoth seem to work okay. Can you link to your page? Remember also that
$().dataTable()
gives you a jQuery instance with the old API and$().DataTable()
is used for the new API.Allan
Hi Allan,
Thanks for the reply.
I did some more testing and it seems that if I make
bDeferRender
equal to false in the options to datatable, then the error doesn't occur, which is kind of interesting.Unfortunately I'm unable to link to the page because it's an intranet page.
1.10 with Ajax loading and deferred rendering enabled: http://live.datatables.net/bawidon/1/edit . I haven't tried the
_
method just yet.Allan
A correction to my opening post. The error doesn't happen in the new API.
However, it does happen with the underscore function of the old API. This code will fail:
http://pastebin.com/8vdzE0rJ
Thanks for the clarification. I suspect the error is in the
tr
part and how DataTables is handling that. Its doing a selector, but the nodes don't exist (since deferred rendering is enabled).I'll take a look into it, but for now, I'd recommend just using the nice new shiny API ;-)
Allan