"this" in rows().every() not working as expected
"this" in rows().every() not working as expected
eric_remotenc
Posts: 3Questions: 1Answers: 0
Why the follwing code shows "this.selected is not a function"
table.rows().every(function () {
if (this.selected()) {
this.select();
}
});
while this one works?
table.rows().every(function () {
this.select();
});
This question has an accepted answers - jump to answer
Answers
Hi,
I've just been trying to reconstruct this, but haven't been able to do so. This was my attempt and it runs successfully.
Maybe you are using an old version of Select?
row().selected()
was introduced in 1.4.0, per its documentation.Failing that, we'd need a link to a test case showing the issue please.
Allan
You're absolutely right! I was using local js Select for DataTables 1.3.1 and didn't notice that.
I really appreciate your reply and feel sorry for not showing a test case before. Now I'm aware of the existence of https://live.datatables.net/ and will try to recreate the problem myself next time. Thank you again. You really saved my day.
No worries. Great to hear that you got it working! Thanks for letting me know.
Allan