Background color of selected column
Background color of selected column
I'm using fnRowCallback to add a class of each TR that contains item that are out of stock:
[code]
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
if(aData[6] == "SOLD OUT")
$(nRow).addClass("disabled");
return nRow;
}
[/code]
My css:
[code]
tr.disabled { background: #ccc; color: #999; }
[/code]
This works fine, except when I click a column to sort, insted of gray background the sorted field gets a blue background (as all other rows).
How do I style so that does'nt happen?
[code]
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
if(aData[6] == "SOLD OUT")
$(nRow).addClass("disabled");
return nRow;
}
[/code]
My css:
[code]
tr.disabled { background: #ccc; color: #999; }
[/code]
This works fine, except when I click a column to sort, insted of gray background the sorted field gets a blue background (as all other rows).
How do I style so that does'nt happen?
This discussion has been closed.
Replies
I think it's because, after sorting the rows are getting shuffled and classes are overridden by some other classes. even while sorting dataTable applies classes to each td.
for more clarification you can go through this.....http://www.datatables.net/styling/
Thanks,
Vivek
Allan