Why are you using
$("#datatable tbody").closest('tr')
?
That's looking for the closest
tr
element which is a parent of the
tbody
element. Unless you're nesting your tables, that won't work.
I suspect you meant to use
$(this).closest('tr')
instead.
Also, the index passed to
.eq()[
^] is zero-based. You're trying to modify the
seventh cell in the row, but it looks like you want to modify the
sixth cell instead.
'render': function (id) {
var validId = $(this).closest('tr').find('td:eq(1)').text();
if (validId.charAt(0) === "@") {
$(this).closest('tr').find('td:eq(5)').removeClass('valid-id');
}
}