no select row with details-control

no select row with details-control

rodolphenrodolphen Posts: 18Questions: 4Answers: 0

Hello,

With datatable 1.10.9, i have a table with these options :

  • select row

select: { style: 'multi' }

  • option details-control

$('#table tbody').on('click', 'td.details-control', function () { ... }

  • and another column (name) you can click on like details-control

All is working but when you click on details-control or name the row is selected. I am looking for the following behavior : when you click on he row, it is select except when you click on name or details-control.

Do you have an idea?

Thank you,

Rodolphe

Replies

  • allanallan Posts: 61,322Questions: 1Answers: 10,023 Site admin

    Hi Rodolphe,

    Sorry for the delay in replying to you here - I missed your message when it was first posted.

    What you need to do to resolve this issue is use the select.selector option. You might use:

    select: {
      style: 'multi',
      selector: 'td:not(.details-control)'
    }
    

    i.e. just refine the selector that Select uses so it doesn't match the element you don't want it to activate on.

    Regards,
    Allan

  • rodolphenrodolphen Posts: 18Questions: 4Answers: 0

    Hi Allan,

    It is so easy... Thank you it works!

    Best regards,

    Rodolphe

This discussion has been closed.