Selected Row Color in 1.12

Selected Row Color in 1.12

ToybToyb Posts: 17Questions: 8Answers: 0

How do I set the selected row color?

The 1.12 release notes say I should be able to just apply the background color.

I can't get the test case to select a row or color the background:
TestCase

Thank for the help!

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin
    Answer ✓

    Actually, the selected row colour is applied using a box-shadow, making it easier to apply a background colour for things like highlighting data.

    This is the primary location for that.

    So:

    table.display.dataTable > tbody > tr.selected > *,
    table.display.dataTable > tbody > tr.odd.selected > *,
    table.display.dataTable > tbody > tr.selected:hover > *  {
      box-shadow: inset 0 0 0 9999px red;
    }
    

    http://live.datatables.net/venagufi/1/edit

    Note that I've disabled orderClasses in that example. With that you'd need to add colouring for the ordering classes as well.

    Better yet would be to change the SCSS variable and rebuild the CSS from that.

    Allan

  • ToybToyb Posts: 17Questions: 8Answers: 0

    Thanks Allan!

Sign In or Register to comment.