editor.mode() is null on submitComplete event
editor.mode() is null on submitComplete event
Hi Allan
I notice that editor.mode() is null on submitComplete
I am trying to use this event to jump to the inserted row after a row insert (as you advised).
How else can I determine what mode the form was in when this event is triggered?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Good point.
submitComplete
is triggered once the form has been cleaned up, so Editor is no longer in an editing mode (hence whymode()
isnull
).Instead, what you could do is use the third parameter passed into the event handler to get the
action
object from it:The
data
parameter is the data submitted to the server, soaction
must be there.Allan
The Editor is submitting "action" to the server, but it is not in the data object returned by the
submitComplete
I was wrong - sorry! My own documentation notes that the third parameter pass in to the event is not in fact the submitted data!
Instead, what I would recommend is that we chain a couple of events:
So basically we make use of
postSubmit
, which does have the action parameter, to add onesubmitComplete
event handler (note the use ofone()
rather thanon()
for the inner event handler), and we can use the action in there as it forms a closure.Regards,
Allan
Great - thanks. Works like a charm.