Recursive access to editor
Recursive access to editor

in Editor
Hello,
I'm spending a couple of hours now on recursive starting up an editor.create window after submitting the previous row.
production_delivery_registrations_multiple_editor.on('submitComplete', function(e, data, action) {
// production_delivery_registrations_create_multiple();
$('.btn-add-multiple').click();
});
Both lines will trigger creation of a new record, but because the previous record is saved, but the javascript code isn't ended yet. This causes strange behaviour.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I'm not sure what your code is doing on
submitComplete
. But I have done something similar and had to put a small delay, using setTimeout before calling the function that invokes a new create window. Without the delay there seems to be a race condition that causes the page to stop functioning after the first submit.Kevin
Thanks. My second intention was to do this by button click.I'll look at the timeOut.
$('.btn-add-multiple).delay(1000).click() doesn't work.
Creating a second button on which is clicked (to get submitComplete) ready and the second button clicks on the button, also gives the race condition.
Dopes delay work with
click()
? The documentation refers only to the jQuery event queue.Try:
Allan
Ok, i got it working
A timeout, less then 200 ms isn't working. for safety, i used 500 ms.
Thanks for time.
Alan, you may close this item.