Possible for "onReturn" to execute a function?
Possible for "onReturn" to execute a function?
hhsiao
Posts: 12Questions: 4Answers: 0
Hello Alan,
Want to know if it is possible for "onReturn" to execute a function instead of just plain "submit"?
Regards,
Henry
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
So I just added this support, for anyone interested
find following
and add following immediately after it
Hi Henry,
Currently no - there isn't an option for that, but its a really good suggestion for a future enhancement. Can I ask what the use case is? I presume you want to do some kind of logic to decide if it should be submitted or not?
Allan
Hi Alan,
Yes indeed I have need to manipulate data before data is sent off. What happen is I wrote a custom buttons call "Update" and then I realize when I hit "Enter" it's just executing "editor.submit()".
Henry
preSubmit
can be used for that.However, I like this idea a lot - I've added it to the feature list for Editor 1.6.
Thanks for the suggestion!
Regards,
Allan
Just in case anyone else finds this discussion while browsing. Editor 1.6 will indeed have the ability to define
onReturn
(and the otheron*
options) as a function.For the use case above
preSubmit
is still the way to go, but the new ability provides other options.Allan
I stumbled across this thread today. How is onReturn supposed to work with functions? I have tried:
and
The first one calls my test function every time I click on the table cell I wish to edit. The second doesn't do anything at all. An example would be great. I made sure to download and "install" v1.6.1 before trying this.
Never mind. I was missing submit().. Got it working! Great addition! Final code:
Perfect. Good to hear you got it working.
Allan