I’m trying really hard to learn how to loop through rows in a jQuery dataTable, not doing too terribly well.
My table id is “partslist”. So:
$("#partslist tr").each(function() {
$($(this) + " td").each(function() {
alert($(this).text());
})
})
You can see that the:
$($(this) + ” td”).each …
is a big fat failure. I want to loop through the columns in each row. It’s funny, with all those examples on the dataTables website, I can’t find a single one that would let me get the data from the table easily.
you can do this:
which finds all of the td’s in selection of tr’s
or this
which finds all the td’s using the selection of tr’s as the scope or “context”
These both accomplish the same thing.