Prevent edit on rowgroup

Prevent edit on rowgroup

info@i-it.seinfo@i-it.se Posts: 9Questions: 3Answers: 0

I'm using Editor and Rowgroup.

This is my event:
$('#dataTablesEditor').on( 'click', 'tbody td:not(:first-child)', function (e) {
editor.inline( table.cell( this ).index(), {
onBlur: 'submit'
} );
} );

How can i disable edit when clicking on the rowGroup tr?
Now i got an error:
ught Error: Cannot edit more than one row inline at a time

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin
    edited January 2023 Answer ✓

    You need to have your selector not be able to pick the cell inside the grouping row. For example you might use:

    'tbody tr:not(.dtrg-group) td:not(:first-child)'
    

    i.e.

    • From the tbody
    • Select rows which do not have the class dtrg-group
    • Then select the cells which are not first child.

    Allan

  • info@i-it.seinfo@i-it.se Posts: 9Questions: 3Answers: 0
    edited January 2023

    @allan Thank you for your reply.

    That worked great ;D

Sign In or Register to comment.