Exlusion of column for selection does not work in responsive dt

Exlusion of column for selection does not work in responsive dt

XtofAmbergXtofAmberg Posts: 4Questions: 2Answers: 0

I cannot get it to work the way I want:

The following test-case is supposed to allow selection via all columns except the first (= 0), which is used for the control of the child row.

https://live.datatables.net/vehekube/3/edit

I used the solution that seems to have worked for others (selector: 'tr td:not(:first-child)'), but it doesn't in my case.

Maybe some dt-master can identify the problem here?

Thank you!

Chris

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,329Questions: 26Answers: 4,949
    Answer ✓

    Your selector: 'td:not(:first-child)' selector is working as expected. You also have this code:

    $("#seitentabelle tbody").on('click', 'tr', function () {  
      $(this).toggleClass('selected');
    });
    

    Which is toggling the selected class no matter where you click in the row. Commenting out $(this).toggleClass('selected'); fixes the issue:
    https://live.datatables.net/hetilepa/1/edit

    Kevin

  • XtofAmbergXtofAmberg Posts: 4Questions: 2Answers: 0

    Kevin, thank you so much!

    You really are a great help! :)

    I totally forgot about that...

Sign In or Register to comment.