Railsアプリの「listings.js」に次のコードがあります。いくつかのデータを表示するためにgemdatatablesを使用しています。この例に示すように、列と行を強調表示したいと思います。しかし、ハイライト機能が私のアプリで機能していません。
//Initialize the datatable
$(document).ready(function()
{
var listingsTable = $('#listings').dataTable(
{
"sPaginationType": "full_numbers",
"bJQueryUI": true,
"bSortClasses": false,
"sScrollX": "90%",
"bScrollCollapse": true,
"sDom": '<"top"iflp<"clear">>rt<"bottom"iflp<"clear">>',
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": $('#listings').data('source')
});
$('td', listingsTable.fnGetNodes()).hover(function()
{
var iCol = $('td').index(this) % 5;
var nTrs = listingsTable.fnGetNodes();
$('td:nth-child('+(iCol+1)+')', nTrs).addClass( 'datatablerowhighlight' );
},
function()
{
$('td.datatablerowhighlight', listingsTable.fnGetNodes()).removeClass('datatablerowhighlight');
} );
});
これが私のlistings.css.scssファイルです
.datatablerowhighlight
{
background-color: #ECFFB3 !important;
}
だから私は何が間違っているのですか?