how to keep from losing data when focus is lost on full row create.

how to keep from losing data when focus is lost on full row create.

jettyappjettyapp Posts: 15Questions: 3Answers: 0
edited October 2021 in Editor

Description of problem:

If you look at the following example:
https://editor.datatables.net/examples/inline-editing/fullRowCreate.html

When you click the "New" button to start creating the row and enter data into a few fields then click somewhere outside of the row you are adding all the data disappears and you have to start all over.

I would like for this to behave in a 'modal' fashion where nothing happens unless you click either a save or cancel icon in the row.

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    edited October 2021 Answer ✓

    That's the onBlur option - see an example of it here. For it to continue editing, use the value none - i.e.

            buttons: [ {
                extend: "createInline",
                editor: editor,
                formOptions: {
                    submitTrigger: -2,
                    submitHtml: '<i class="fa fa-play"/>',
                    onBlur: 'none'
                }
            } ]
    

    Colin

  • jettyappjettyapp Posts: 15Questions: 3Answers: 0

    Works perfectly! thank you Colin!

Sign In or Register to comment.