Selected Row Color in 1.12

Selected Row Color in 1.12

ToybToyb Posts: 19Questions: 9Answers: 1

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: 63,535Questions: 1Answers: 10,475 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: 19Questions: 9Answers: 1

    Thanks Allan!

Sign In or Register to comment.