Quantcast
Channel: DataTables 1.10 — DataTables forums
Viewing all articles
Browse latest Browse all 2364

How do I add a class to a specific column when using the columns.every function?

$
0
0

I have the following code which works when the column 0 is not hidden.
What I am trying to do is check the values in a hidden column 0 and change the class of column 1 based on the text value in column 0.
I am open to doing this another way, like with rows.every if that is easier, but I am not clear on how to accomplish this.

                        table.columns(0).every(function() {
                            this.nodes().to$().each(function() {
                                if ($(this).text() == 'sometext') {
                                } else {
                                    $(this).next('td').addClass('highlight');
                                }
                            });
                        });

Viewing all articles
Browse latest Browse all 2364

Trending Articles