In my createdRow function for my datatable, I am trying to remove a class from the last TD. Below is the code for the function. The add class was just a test to see if the function was being fired and it seems to be because the “test” class is added to the last TD. but the remove class function doesn’t remove the class. I can’t seem to figure it out, I know I could (maybe) loop through the classes after it’s created but I thought to use the native functions of DataTables and this is really bugging me so I want to try and figure it out.
createdRow: function(row,data,dataIndex){
console.log(jquery(row).find("td:last")); //prints the last td in each row
jquery(row).find("td:last").addClass("test");//this works the last TD of the table has class test
jquery(row).find("td:last").removeClass("dt-type-date");// class is still listed in the td
jquery(row).find("td:last")[0].removeClass("dt-type-date");//tried this as well but this gives me an error that removeClass is not a function.
}
1