rowreorder - exclude checkbox from selector td

rowreorder - exclude checkbox from selector td

vinamavinama Posts: 6Questions: 3Answers: 1
edited October 14 in Free community support

Hello.

When I use the first column as a selector for rowreorder and there is a checkbox in that column, I'm unable to check/uncheck it because that will trigger the rowreorder event first. Is there a way to specify a selector that will exclude the checkbox/span in the example? Or other type of solution? I tried 'td:first-child:not(:has(input[type="checkbox"]))' and some variants, but was not able to get it to work.

https://live.datatables.net/cayenowi/1/edit?html,css,js,console,output

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,602Questions: 1Answers: 10,486 Site admin

    I'd say don't use the first column for two different actions. Have two columns - one for the row moving, and the other for the checkbox.

    To make what you currently have work, you'd need to modify the RowReorder library to ignore the mousedown on the input element.

    Allan

  • vinamavinama Posts: 6Questions: 3Answers: 1
    edited October 15 Answer ✓

    Thank you for your response. I created an additional div at the same level as <div class="checker"> and configured the selector to target that element.

Sign In or Register to comment.