Hi everyone .
I have the following use case:
My data is from multiple tables that are being joined. Most of it is 1:1 relation, but some is 1:n.
Now I want to omit the duplicate data from my Datatable, at least when it's appropriately sorted, and I'm facing some side effects.
Here's an example for what I want to do:
https://live.datatables.net/julaqeba/3/edit
The relevant stuff is in the rowCallback function.
What my example does is:
- checking if two lines following each other have an identical Position text
- if so, omit the Position text from all rows following the first one
This works, but I have to invalidate all rows, otherwise, when I re-sort the table, bad things happen.
Now, I have an unexpected side effect: with default ordering, you'll notice that the Salary column in the first row is right aligned while it is left aligned in all following rows.
Somehow, my row invalidation efforts are removing the dt-type-numeric class from all but the first row (in my actual application, it removes the date class etc.).
Can somebody shed some light as to why that happens or maybe I'm overcomplicating things in my approach?
Thanks bunch in advance!