goldfinger
goldfinger

Reputation: 1115

jquery dataTables - class attribute changes with column sort

I have created a table with specific class attribute where background color of the depends upon the class attribute. I use static inline css to define the background color.

I construct the table then use dataTables to give me search/sort capabilities. All looks good. Then when I click one of the column sort arrows (native sort feature in dataTables), sort works but all background color disappears.

Is dataTables modifying class attributes as a by-product of sort?

Upvotes: 1

Views: 3794

Answers (1)

Lukasz Koziara
Lukasz Koziara

Reputation: 4320

When activating sorting on specific column, dataTables plugin add some classes to <td> (.sorting1) and <tr> (.sorting_desc/.sorting_asc) elements.

These will be usefull for you:

Upvotes: 1

Related Questions