AutoFill with inline editing only submitting partial row data

AutoFill with inline editing only submitting partial row data

bg7bg7 Posts: 126Questions: 18Answers: 0

We're using inline editing and KeyTables to edit data directly in the table cells. The configuration is set up like this:

    inline: {
      onBlur: 'submit',
      submit: 'allIfChanged',
    },

as we want the full row data submitted on every change.

https://editor.datatables.net/reference/type/form-options#submit

We're also using AutoFill. However, with AutoFill it only seems to submit partial row data. This means we have to merge it with that row's data before we submit it. Is there a way to configure AutoFill to submit all the data for the row just like the inline setting does above?

Thanks.

Ben

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 65,793Questions: 1Answers: 10,945 Site admin
    Answer ✓

    Hi Ben,

    AutoFill doesn't actually use inline editing for the submit, but rather uses bubble editing. So if you change your code to:

    bubble: {
      submit: 'allIfChanged',
    },
    

    I expect it to do what you are looking for.

    The reason for the use of bubble editing in AutoFill is a bit historical. It used to be that inline editing only supported a single cell and a single row. That was relaxed somewhat in newer releases (albeit some restrictions remain), but bubble editing allows multiple cells and multiple rows, which is what we need for AutoFill.

    Allan

  • bg7bg7 Posts: 126Questions: 18Answers: 0

    Allan,

    That works great! Interesting about the history.

    Btw, if this were added to the AutoFill documentation I'm guessing I'm not the only one who'd take advantage of it. Maybe here?

    https://datatables.net/extensions/autofill/

    or here?

    https://datatables.net/reference/option/?extn=autofill

    Thanks.

    Ben

  • allanallan Posts: 65,793Questions: 1Answers: 10,945 Site admin

    KeyTable has a editorOptions configuration option (which frustratingly I see isn't actually documented yet!) and I'm thinking that something like that would be the right thing to do for AutoFill and would be a sensible place for this to be documented.

    Added to my tracker :)

    Allan

Sign In or Register to comment.