no select row with details-control

no select row with details-control

rodolphenrodolphen Posts: 13Questions: 3Answers: 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: 54,909Questions: 1Answers: 8,606 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: 13Questions: 3Answers: 0

    Hi Allan,

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

    Best regards,

    Rodolphe

This discussion has been closed.