I seem to have run into an issue when trying to use checkboxes and inline editing.

I seem to have run into an issue when trying to use checkboxes and inline editing.

JJGJJG Posts: 14Questions: 4Answers: 0

When a checkbox column is used with inline editing enabled you cannot simply click on the checkbox to change its value. Instead you appear to be dropped into an editing mode where the checkbox can then be changed and is submitted subsequently. The "permanent inline checkbox" example works as expected but if you add:
// Activate an inline edit on click of a table cell
$('#example').on( 'click', 'tbody td:not(:first-child)', function (e) {
editor.inline( this, {
onBlur: 'submit'
} );
} );

it exhibits the behaviour described.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,268Questions: 26Answers: 4,765
    Answer ✓

    You need to use jQuery selectors to select the columns you don't want to inline edit like the checkbox columns. For example:

        $('#example').on( 'click', 'tbody td:not(:first-child, :nth-child(6), :nth-child(7), :last-child)', function (e) {
            editor.inline( this, {
                onBlur: 'submit',
            } );
        } );
    

    Kevin

  • JJGJJG Posts: 14Questions: 4Answers: 0

    Thanks, I now understand.

    I must have missed the inline checkbox editing example showing the mode switch and thus made a very poor assumption.

    Thanks again!

This discussion has been closed.