Can formOptions be updated through the API?

Can formOptions be updated through the API?

Loren MaxwellLoren Maxwell Posts: 406Questions: 99Answers: 10

I was wanting to "Escape" out of an input without escaping out of Editor in total
(Like this post for Select2: https://datatables.net/forums/discussion/comment/137347/#Comment_137347)

My thought at the moment is to set onEsc based on the state of the input (i.e., input has focus or not):
(WARNING: SYNTAX MAY BE HORRIBLY OFF, but I think you'll get the gist)

.on("input_onFocus", function () {
    editor.formOpts.main.onEsc('none'`)
})
.on("input_onBlur", function () {
    editor.formOpts.main.onEsc('blur'`)
})

However it doesn't appear formOptions can be changed.

This question has an accepted answers - jump to answer

Answers

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

    You can't change the properties of an opened form, as it's an initialisation option and can't be changed afterwards. The code in the thread you posted is the way to go - have the onEsc as a function and use logic in there to determine if the select2 is in focus/active.

    Colin

  • Loren MaxwellLoren Maxwell Posts: 406Questions: 99Answers: 10

    Thanks, @colin!

This discussion has been closed.