Peacefull Peacefull -4 years ago 170
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 ->

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download