to$() and toJQuery() work with nodes() but not node()
to$() and toJQuery() work with nodes() but not node()
![Loren Maxwell](https://datatables.net/forums/uploads/userpics/907/nQU402M3AJ88T.jpg)
Not sure if this is a bug or not, but . . .
I happen to notice to$()
and toJQuery
both with with nodes()
but not with node()
.
That seems to be correct according to here: https://datatables.net/reference/api/toJQuery()
However it seems odd that to$()
and toJQuery
wouldn't work with a single node as well.
This question has an accepted answers - jump to answer
Answers
APIs like
rows().nodes()
andcells().nodes()
return an API instance along with the results. So you can chainto$()
ortoJquery()
.The
row().node()
andcell().node()
return just the node without the API instance so chaining won't work. You can put these in a jQuery object ($()
) to use jQuery methods.Kevin
Thanks, Kevin -- you're right, it hasn't stopped me because I typically use
$()
on the node(s) anyway.It just seems inconsistent from
rows().nodes()
and additionally the description is essentially the same for both: "Get the row TR node(s) for the selected row(s)."Anyway, I wanted to make sure it was intentional design decision and not an oversight!
Loren