Changing row color doesn't affect sorted column

Changing row color doesn't affect sorted column

markjomarkjo Posts: 66Questions: 0Answers: 0
edited May 2013 in General
Inside my datatable I change a row's column with this:
[code]$('#id12').closest("tr").css('background-color', 'red');[/code]
Row's background color changed to red. Except the column that is sorted.
That column's color is still the same.

Then I put an important tag, but it didn't change anything.
[code]$('#id12').closest("tr").css('background-color', 'red', 'important');[/code]

Replies

  • markjomarkjo Posts: 66Questions: 0Answers: 0
    I added a demo to here:
    http://live.datatables.net/iwazex/3/

    2nd and 3rd rows become red except the 8th column cell.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    This class is overriding it: `tr.even td.sorting_1`. Just remove it form your CSS.

    Allan
  • markjomarkjo Posts: 66Questions: 0Answers: 0
    Thank you very much it solved :)

    I suppose "!important" doesn't affect child elements.
  • markjomarkjo Posts: 66Questions: 0Answers: 0
    edited May 2013
    I use "myCallback()" for fnDrawCallback of table.
    I suppose I also need to remove class inside the function of myCallback().
    Because after removing "sorting_1" and then clicking column title, "sorting_1" class appears again.
    Must I remove class inside the callback ?
    Thank you.
  • markjomarkjo Posts: 66Questions: 0Answers: 0
    Thank you very much :)
This discussion has been closed.