Disable sorting classes on specific columns
Disable sorting classes on specific columns
I have a column with predefined background colors which must remain visible when it's sorted. Is this possible?
As a hack I was letting css simply ignore the first column, but the ":not" pseudo-class isn't supported in IE8.
[code].dataTables_wrapper tr.even td:not(:first-child).sorting_1[/code]
As a hack I was letting css simply ignore the first column, but the ":not" pseudo-class isn't supported in IE8.
[code].dataTables_wrapper tr.even td:not(:first-child).sorting_1[/code]
This discussion has been closed.
Replies
Allan
Allan
https://beta.propertypreswizard.com/test_scripts/beta/home.php
This css is loaded first from wo_status.css (1st column td color):
[code].wo_status__invoiced {
background-color: #074BA7 !important;
color: #FFFFFF !important;
} [/code]
Then from datatables.css (sorted column):
[code].dataTables_wrapper tr.even td.sorting_1, .dataTables_wrapper tr.even td.sorting_2, .dataTables_wrapper tr.even td.sorting_3 {
background-color: #E4E4E4;
}
/*.dataTables_wrapper tr.odd td:not(:first-child).sorting_1, .dataTables_wrapper tr.odd td.sorting_2, .dataTables_wrapper tr.odd td.sorting_3 {*/
.dataTables_wrapper tr.odd td.sorting_1, .dataTables_wrapper tr.odd td.sorting_2, .dataTables_wrapper tr.odd td.sorting_3 {
background-color: #f7f7f7;
}[/code]
Then when you highlight:
[code].dataTables_wrapper tr:hover td{
background-color: #d4e3fc;
color: #000;
}[/code]
[code]
.dataTables_wrapper tr:hover td{
background-color: #d4e3fc !important;
color: #000;
}
[/code]
You might need to increase the priority of your first code block as well:
[code]
.dataTables_wrapper tr td.wo_status__invoiced {
background-color: #074BA7 !important;
color: #FFFFFF !important;
}
[/code]
Allan