Disable CSS for a row

Disable CSS for a row

KarkuroKarkuro Posts: 7Questions: 5Answers: 0

I have a working datatable (that I could make work with the help of my previous posts here).

http://i.imgur.com/5esb6Zv.png

It is responsive, with a expandable feature :

http://i.imgur.com/XuyoMUv.png

The thing is, as you can see, the grouping row has a "+" too, even if it doesn't expand. How can I disable that only for this row ?

Here is the code :

    $(document).ready(function() {
             $('#datatable').DataTable( {
             "ajax": "<?php echo base_url()."assets/files/data/data.txt"; ?>" ,
             "columns": [
                { "data": "etat" },
                { "data": "date" },
                { "data": "dest" },
                { "data": "message" },
                { "data": "exp" }
                ],
                "columnDefs": [
                { "visible": false, "targets": 1 }
                ],
                "order": [[ 0, "desc" ]],
                "responsive": true,
                 drawCallback: function (settings) {
                var api = this.api();
                var rows = api.rows({ page: 'current' }).nodes();
                var last = null;
    
                api.column(1, { page: 'current' }).data().each(function (group, i) {
    
                    if (last !== group) {
    
                        $(rows).eq(i).before(
                            '<tr class="group"><td colspan="8" style="BACKGROUND-COLOR:rgb(212, 212, 212);font-weight:700;color:#1F1F1F;">' + 'Alarme du ' + group  + '</td></tr>'
                        );
    
                        last = group;
                    }
                });

And I'm using this CSS file :

https://cdn.datatables.net/responsive/2.0.2/css/responsive.jqueryui.min.css

I was thinking of create a specific class only for this row, but I don't know how to put that in the datatable specific row.

Answers

  • allanallan Posts: 63,230Questions: 1Answers: 10,417 Site admin

    You would need to modify the selector that is used to show the icon to include a :not() pseudo statement.

    Allan

This discussion has been closed.