Disable edit on one cell

Disable edit on one cell

Igorski88Igorski88 Posts: 25Questions: 8Answers: 0

What is the best practice to disable inline edit on one cell depending on its content.
I tried the below but it disabled editing for the entire row:

                    $('#CustomTransactionsDataTable').on('dblclick', 'tbody td', function (e) {
                        var table = $('#CustomTransactionsDataTable').DataTable();
                        var rowData = table.row(this.parentNode).data();

                        if (rowData.TypeOfEvent.includes("One Time Only")) {

                            editor.inline(this);
                        }

                });

I also tried looking into cell().edit() but I keeping getting a "This.Node is not a valid node". Maybe I wasn't using it right.

Any suggestions?

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,598
    Answer ✓

    Hi @Igorski88 ,

    This example from this thread should help. It's for bubble editing but the principle would be the same

    Cheers,

    Colin

  • Igorski88Igorski88 Posts: 25Questions: 8Answers: 0

    Works Like a charm!!! I noticed that in the docs yesterday and it didn't quit work the way I tried and gave up to fast. DataTables is so extensive and purchasing the editor was the best decision I made for my project. Thanks for all the support!!

This discussion has been closed.