Peacefull Peacefull - 1 year ago 53
Ajax Question

DataTables multi select rows issue with button in table

I'm trying to use the multi select rows function of DataTables, for now that make the job but when i add a

"defaultContent": "<button class='btn_planning'>Show</button>"
in my table there is a problem. That select the row when i click on button too :\

Live example :

Answer Source

The easiest would be to turn off the selector for the specific column holding a <button> :

select: {
  style: 'os',
  selector: 'td:not(:nth-child( COLUMN_INDEX ))' //dataTable column index + 1

see demo ->