FixedColumns and Inline Editor: Editing Main Table

FixedColumns and Inline Editor: Editing Main Table

PaulusPaulus Posts: 69Questions: 17Answers: 5

I have a large table with the first 3 columns fixed. I wish to activate the inline editor only for the last two columns with the following codes

$('#TableID').on('click', 'tbody td:nth-last-child(-n+2)', function (e) {
    editor.inline(this, {
        onBlur: 'submit',
        submit: 'allIfChanged'
    });
});

This seems to work, but the last fixed column also becomes editable. I do not wish to edit any of the fixed columns, what is the best way to handle this?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 64,688Questions: 1Answers: 10,697 Site admin
    Answer ✓

    That's a bit on the peculiar side! I'm fairly certain it is being caused by FixedColumns cloning the events on the host table.

    What we can do to work around that is add a little if condition:

    if ( $(this).parents('#TableID').length ) {
       editor.inline( ... );
    }
    

    Allan

  • PaulusPaulus Posts: 69Questions: 17Answers: 5

    Thanks Allan, this works perfectly.

This discussion has been closed.