Fixed table Row select inverses the '.selected' value

Fixed table Row select inverses the '.selected' value

narendran.kandannarendran.kandan Posts: 4Questions: 2Answers: 0
edited November 2018 in Free community support

My requirement is select a row and delete it by clicking on DELETE button. My table has first 4 columns as fixed. When i click on any cells on the fixed column the row gets selected but the " $(this).toggleClass('selected'); " value is set to 0 instead of 1. The fixed cells alone returns inverse value for row select. Please find my sample code

 $('#example tbody').on( 'click', 'tr', function () {
        var _table = $('#example').DataTable();     
        var _delbtn = _table.button(6);

        $(this).toggleClass('selected');   
     
        if ( _table.rows('.selected').data().length === 0 ) {
            _delbtn.disable();
        }
        else {          
            _delbtn.enable();
        }
    } );

I tried setting select property to true for fixed columns but nothing changed.

         "fixedColumns" : {
               "leftColumns" : 4,
               "select": true
            }

Please help me out on this.

Answers

This discussion has been closed.