Peacefull Peacefull - 3 months ago 11
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 :

live.datatables.net

Answer

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 -> http://jsfiddle.net/f8ke0wwk/

Comments