Row class with server side, but does nothing ,

Row class with server side, but does nothing ,

CouinCouin Posts: 12Questions: 4Answers: 0
edited June 2021 in Free community support

Hi,

I try to customize a serverside mode datatable so I would have some backgroung color for rows, depending of color returned by the data.php file.

In the data.php, I added :
$nestedData["DT_RowClass"] = $tracktype;
$tracktype if for the type a played track (RadioDJ), it can be "music" , "jingle", "podcast" etc etc...

No problem, the class appear if I check with the webbrowser inspector :
<tr id="trid_183462" class="jingle odd" role="row">

In the head of the page, I added after :
<script type="text/javascript" language="javascript" src="js/jquery.dataTables.js"></script>

theese lines :
<style> tr.jingle { background-color: #FF0000; } </style>

But id does turn the backgroung color of the row to "red" color .

Where I did a mistake ?

Thanks :)
Couin

Edit : Found a way by changing "tr.jingle" for "table.dataTable.display tbody tr.jingle" in the style tag.
Perhaps a better solution ?

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    That solution seems sensible!

    Colin

Sign In or Register to comment.